Custom Numeric Chart

A custom-numeric chart puts any numeric quantity on the horizontal axis. Unlike the candlestick / line / area family (which require time on the x-axis) and unlike the yield-curve chart (which expects months) and the options chart (which expects strikes), tvl.custom_numeric makes no assumption about what your x-values mean.

Internally tvl.custom_numeric uses the same createOptionsChart renderer as tvl.options_chart. Use it whenever your x-axis is a generic numeric quantity (frequency in Hz, distance in km, price level for a profile chart, basket index) rather than time, maturity, or strike.

What are custom-numeric charts useful for?

  • Frequency / Bode plots: Magnitude or phase vs. frequency on a numeric axis with no time semantics.
  • Distance / depth profiles: Price vs. depth-of-book level, density vs. depth, anything indexed by a numeric position.
  • Price-level profiles: Volume profile, market profile (TPO), and any other “histogram by price level” rendering.
  • Custom indices: Basket weights vs. constituent number, regression coefficients vs. feature index: any “value vs. integer position” view.

Examples

A basic line on a numeric x-axis

The chart treats x as a numeric coordinate, so any numeric column will do. Pass it explicitly along with the value column. Build a small synthetic table inline by attaching an integer X to the tvl.data.values() series.

The line traces Value over the integer x-axis. Reuse a strike, tenor, or any other numeric column verbatim when you want a generic numeric rendering of data you might otherwise feed to options_chart or yield_curve.

Note

Viewport-aware downsampling currently only applies to time-axis charts (chart_type == "standard"). Custom-numeric charts ship raw rows to the client, so keep the input table modest (tens of thousands of rows) or pre-aggregate server-side.

Switch to an area rendering

series_type="area" swaps the line for a filled area. Combine it with top_color, bottom_color, and line_color for a custom gradient.

The gradient fades to transparent at the bottom.

Switch to a histogram rendering

series_type="histogram" renders one bar per row, a natural fit for volume-profile and market-profile views where the x-axis is a price level.

A purple bar rises at each integer x-value.

Customize color, width, and title

In line and area modes, color, line_width, and title work the same way as in the other chart types. line_width is an integer pixel width 1-4.

The line is blue, three pixels wide, with a custom legend entry.

API Reference

Use this when the x-axis represents arbitrary numeric values (frequency, distance, price level, etc.) rather than timestamps. Internally uses the same createOptionsChart renderer as options_chart(), which provides a linearly-spaced numeric horizontal scale.

Returns: TvlChart A chart with a generic numeric x-axis.

Raises: ValueError -- If series_type is not "line", "area", or "histogram".

ParametersTypeDefaultDescription
tableAnyDeephaven table with the data.
xstr'X'Column name for the x-axis (numeric values).
valuestr'Value'Column name for the y-axis.
series_typestr'line'"line" (default), "area", or "histogram".
colorOptional[Color]NoneLine / histogram color.
line_widthOptional[LineWidth]NoneStroke width in pixels (1–4).
titleOptional[str]NoneTitle shown in the series tooltip / legend.
line_colorOptional[Color]NoneArea-only: explicit line color.
top_colorOptional[Color]NoneArea-only: top gradient fill color.
bottom_colorOptional[Color]NoneArea-only: bottom gradient fill color.
background_colorOptional[Color]NoneChart background CSS color.
text_colorOptional[Color]NoneAxis / label text color.
crosshair_modeOptional[CrosshairMode]NoneCrosshair mode; see CrosshairMode.
watermark_textOptional[str]NoneSingle-line watermark text.