Area Chart

An area chart is a line chart with a vertical gradient fill underneath. The fill shows the magnitude of the value as well as its trajectory. Use it for single-series time series where you want to emphasize how much, such as equity curves, cumulative volume, or account balance, rather than the shape of small fluctuations.

The fill is a vertical gradient between top_color (just below the line) and bottom_color (at the chart bottom).

What are area charts useful for?

  • Emphasizing magnitude: The shaded region under the line shows how big the value is, in addition to where it’s going.
  • Single-series time series: When there is only one quantity to plot, an area chart carries more visual weight than a bare line and still reads as a trend at a glance.
  • Cumulative quantities: Volume traded, P&L, balance, headcount, and anything else that accumulates suits an area chart.
  • Dashboard tiles: A filled area stays legible on small chart tiles where the line alone would be too thin to register.

Examples

A basic area chart

Pass a table with a timestamp column and a value column. With tvl.data.values() (columns Timestamp and Value) the defaults already match, but they are shown here explicitly for clarity.

The line traces the value; the area below it fades from the top color to the bottom color.

Customize the gradient

top_color is the gradient stop at the line; bottom_color is the stop at the bottom of the chart. Both accept a Deephaven theme color (e.g. "orange-800", "accent-300"), a hex code ("#1f8a70"), a named CSS color ("crimson"), or an rgb()/rgba() string for transparency. Theme colors adapt automatically when the user switches themes; hardcoded values do not.

The gradient runs from a deep amber at the line down to fully transparent at the chart bottom.

Line width

line_width sets the outline thickness as an integer 1-4 (the LWC default is 3). Wider outlines stand out on dashboards; thinner outlines disappear into the gradient on detail charts.

The outline is now one pixel wide.

One area per group with by

Set by to a partition column and the chart draws one area per unique value, each with its own auto-assigned color from the user’s theme palette. This is useful for comparisons, but note that the areas overlay rather than stack arithmetically.

Each symbol gets its own translucent area, automatically colored.

Invert the filled area

invert_filled_area=True flips the gradient so the area is drawn above the line instead of below it. This is the typical layout for “deficit” or “below-baseline” views, where the value of interest is the gap between the line and the top of the chart.

The shaded region now extends from the line up to the top of the chart rather than down to the bottom.

Line color and a relative gradient

line_color sets the outline color independently of the fill. relative_gradient=True anchors the gradient stops to the series’ value range rather than the visible pane, so the fill keeps consistent colors as the chart scrolls.

Per-point colors from columns

line_color_column, top_color_column, and bottom_color_column drive the line and the two gradient stops from per-row table columns of color strings.

API Reference

Renders a filled area between the value line and the bottom of the chart, using a vertical gradient between top_color and bottom_color.

Returns: TvlChart A chart wrapping a single area series (or one per partition when by is set).

ParametersTypeDefaultDescription
tableAnyDeephaven table with the data.
timestampstrColumn name for the time axis.
valuestrColumn name for the y-axis.
line_colorOptional[Color]NoneLine color at the top of the filled area.
top_colorOptional[Color]NoneGradient fill color at the top.
bottom_colorOptional[Color]NoneGradient fill color at the bottom (typically transparent).
relative_gradientOptional[bool]NoneIf True, the gradient is measured relative to the series values rather than the chart bounds.
invert_filled_areaOptional[bool]NoneIf True, fill above the line instead of below.
line_widthOptional[LineWidth]NoneStroke width 1–4 px.
line_styleOptional[LineStyle]NoneDash pattern; see LineStyle.
line_typeOptional[LineType]NoneGeometry between data points; see LineType.
line_visibleOptional[bool]NoneShow the line.
point_markers_visibleOptional[bool]NoneShow point markers at every data point.
point_markers_radiusOptional[float]NonePoint marker radius.
crosshair_markerOptional[CrosshairMarker]NoneStyling for the crosshair marker dot; build with crosshair_marker().
last_price_animationOptional[LastPriceAnimationMode]NoneLast-price dot animation.
last_value_visibleOptional[bool]NoneShow the last-value badge.
titleOptional[str]NoneTitle.
visibleOptional[bool]NoneSeries visibility.
price_scale_idOptional[str]NonePrice-scale ID.
price_formatOptional[PriceFormat]NonePer-series price format.
last_price_lineOptional[LastPriceLine]NoneStyling for the auto last-price horizontal rule; build with last_price_line().
base_lineOptional[BaseLine]NoneStyling for the zero/index base line; build with base_line().
price_scaleOptional[PriceScale]NoneOptions for the price scale this series binds to; build with price_scale().
line_color_columnOptional[str]NonePer-row line color column.
top_color_columnOptional[str]NonePer-row top-color column.
bottom_color_columnOptional[str]NonePer-row bottom-color column.
paneOptional[int]NonePane index.
markersOptional[list[Marker]]NoneStatic markers.
price_linesOptional[list[PriceLine]]NoneHorizontal price lines.
marker_specOptional[MarkerSpec]NoneTable-driven marker spec.
continuousboolTrueTrue (default) = time-proportional chart axis; False opts the whole chart back to the plain ordinal layout. See line_series().
byOptional[str]NoneColumn name to partition the table by. When set, one runtime series is created per unique value; new partition keys discovered at runtime (ticking tables) add new series automatically.
on_pressOptional[PressEventCallable]NoneServer-side callback invoked when the user presses (clicks) on the chart. Receives a TvlPressEvent dict, or no argument.
on_double_pressOptional[PressEventCallable]NoneServer-side callback invoked when the user double-presses on the chart.