Options Chart
An options chart plots a quantity against strike price on a numeric horizontal axis, not against time. The renderer is TVL’s createOptionsChart, which is designed for cross-sectional snapshots indexed by strike: option bid/ask curves, implied-vol smiles, open-interest profiles, and gamma exposure.
tvl.options_chart supports three series types: "line" (default), "area", and "histogram". They share the same axis behavior; only the rendering changes.
What are options charts useful for?
- Option price curves: Plot CallBid/CallAsk across strikes to see the price structure across the chain.
- Volatility smiles: Implied vol vs. strike is the “smile” or “skew” chart this rendering is built for.
- Open interest / volume profiles: Histogram mode turns the same chart into a strike-indexed bar chart of open interest or daily volume.
- Gamma exposure: Net gamma by strike (positive bars above zero, negative below) reads cleanly as a histogram or signed line.
Examples
A basic options curve
tvl.data.options_chain() is a 21-strike snapshot with columns Strike, CallBid, CallAsk, PutBid, PutAsk. Point strike and value at the right columns; defaults pick series_type="line".
A single line traces call bids from the 50 strike to the 150 strike.
Switch to an area rendering
series_type="area" fills the area under the curve. Useful for “stacked” reads of a single quantity (e.g. notional gamma) where the magnitude under each strike matters.
The filled area fades to transparent at the bottom; the rim is solid red.
Switch to a histogram rendering
series_type="histogram" renders one bar per strike. Pair it with the color parameter and a stronger contrast so the bars register clearly.
One purple bar rises at each of the 21 strikes.
Customize color and width (line mode)
color is the line CSS color; line_width is the integer pixel width (1-4); title is the legend label.
The line is green, two pixels wide, with a custom legend entry.
Plot a different value column
The y-axis can be any numeric column. Swap CallBid for PutAsk (or implied vol, open interest, gamma, whatever your table has) without touching the rest of the call.
The chart now traces the put-ask curve instead of the call-bid curve.
API Reference
The horizontal axis represents strike prices (numeric) and the chart is rendered via the TVL createOptionsChart backend. For non-strike numeric x-axes (frequency, distance, etc.), prefer custom_numeric(), which uses the same renderer with a more descriptive name and parameter (x instead of strike).
Returns: TvlChart An options chart with a single series.
Raises: ValueError -- If series_type is not "line", "area", or "histogram".
| Parameters | Type | Default | Description |
|---|---|---|---|
| table | Any | Deephaven table with the data. | |
| strike | str | 'Strike' | Column name for the x-axis (strike prices, numeric). |
| value | str | 'Value' | Column name for the y-axis. |
| series_type | str | 'line' | "line" (default), "area", or "histogram". |
| color | Optional[Color] | None | Line / histogram color. For area series, falls back to line_color when set. |
| line_width | Optional[LineWidth] | None | Stroke width in pixels (1–4). |
| title | Optional[str] | None | Title shown in the series tooltip / legend. |
| line_color | Optional[Color] | None | Area-only: explicit line color. |
| top_color | Optional[Color] | None | Area-only: top gradient fill color. |
| bottom_color | Optional[Color] | None | Area-only: bottom gradient fill color. |
| background_color | Optional[Color] | None | Chart background CSS color. |
| text_color | Optional[Color] | None | Axis / label text color. |
| crosshair_mode | Optional[CrosshairMode] | None | Crosshair mode; see CrosshairMode. |
| watermark_text | Optional[str] | None | Single-line watermark text. |