Bar (OHLC) Chart

A bar chart renders each OHLC interval as a vertical range bar with a short tick on the left for the open and a short tick on the right for the close. Use it when you want the readability of OHLC data but prefer a thinner, less ink-heavy rendering than candlesticks. It works well for very dense intraday charts, and when you plan to layer markers on top.

Like candlesticks, bars are color-coded by direction: an up bar has the close above the open, a down bar has the close below the open. Because the body is just two ticks instead of a filled rectangle, you can fit many more bars in the same horizontal space.

What are OHLC bar charts useful for?

  • Dense intraday charts: Bars take less horizontal pixel space than candles, so a 1-minute chart over a full session stays readable.
  • Overlays and annotations: A thinner price track leaves room for markers, price lines, and secondary series without visual conflict.
  • Western technical analysis: Many classical Western (vs. Japanese) chart conventions assume OHLC bars and read them more naturally than candles.
  • Volatility scans: Long vertical bars with ticks close together flag wide-range, indecisive periods.

Examples

A basic bar chart

tvl.bar consumes the same OHLC table layout as tvl.candlestick. The tvl.data.ohlc() helper already has the canonical column names so the call is a one-liner.

Each row in data becomes one vertical bar with an open tick on the left and a close tick on the right. When up_color / down_color are not provided, the chart pulls them from the active Deephaven theme palette so the same code reads correctly in both light and dark themes.

Map non-default OHLC column names

When your table uses different column names (say Ts/O/H/L/C from a custom upstream join), pass them as kwargs. The chart only reads the columns you point at.

Customize up and down colors

up_color and down_color set the bar color for up and down intervals. The bar (range line plus open/close ticks) inherits a single color per bar, unlike candlesticks where bodies and borders can diverge.

Both up_color and down_color accept a Deephaven theme color (e.g. "seafoam-800", "accent-300"), a hex code ("#26a69a"), 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. Leave them unset to inherit the active theme’s palette.

Set a chart title

title is the series legend label. Visible on hover and in the legend area. Use it whenever the chart will be embedded next to other content where the column names are not self-explanatory.

The legend now reads “ES futures, 1m bars”.

Server-side autobinning

Hand the chart a large OHLC table and TVL automatically aggregates it server-side into a viewport-friendly number of buckets. Override the bucket count or width via bin_count / bin_width, or set auto_bin=False to bypass it entirely for small tables.

See autobin for the full autobin surface: ISO-8601 duration grammar, when each auto_bin value is the right pick, and how the path interacts with the downsampler.

Time-proportional layout with continuous

By default (continuous=True) bars are laid out proportionally in time. Unlike the histogram, the open/close ticks are not drawn end-to-end — each bar keeps the classic proportions, and the ticks of adjacent bars never touch — but sections of data separated by a time hole (a market close, a halted feed, missing rows) are separated by a proportional open gap. On data with no holes, continuous=True and continuous=False look the same. Set continuous=False to restore the plain ordinal layout, which collapses any time hole to a single bar-width step.

Thin bars and hidden open ticks

Two bar-specific styling options trim the visual weight of each bar. thin_bars=True renders each bar with a narrower body, which is useful on very dense intraday charts; open_visible=False hides the short left “open” tick so each bar shows only the range line plus the right “close” tick, a cleaner look when the open price is not the focus.

The bars are now thinner and the left-side open tick is gone.

API Reference

Bar series render each bucket as a vertical line with small open/close ticks; contrast with candlestick_series() which fills the body. Same auto-bin behavior as candlestick.

Returns: TvlChart A chart wrapping a single bar series.

ParametersTypeDefaultDescription
tableAnyDeephaven table containing OHLC data.
timestampstr'Timestamp'Column name for the time axis.
openstr'Open'Column name for the opening price.
highstr'High'Column name for the bar high.
lowstr'Low'Column name for the bar low.
closestr'Close'Column name for the closing price.
up_colorOptional[Color]NoneBar color for up-bars.
down_colorOptional[Color]NoneBar color for down-bars.
open_visibleOptional[bool]NoneShow the open tick (default True).
thin_barsOptional[bool]NoneUse thin bar style.
titleOptional[str]NoneTitle shown in the series tooltip / legend.
visibleOptional[bool]NoneSeries visibility.
last_value_visibleOptional[bool]NoneShow the last-value badge.
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().
color_columnOptional[str]NoneColumn name supplying per-row bar color.
paneOptional[int]NonePane index.
markersOptional[list[Marker]]NoneStatic markers.
price_linesOptional[list[PriceLine]]NoneHorizontal price lines.
marker_specOptional[MarkerSpec]NoneTable-driven marker spec.
auto_binOptional[bool]NoneAuto-bin tri-state. See candlestick_series() for full semantics.
bin_widthOptional[str]NoneISO 8601 duration override.
bin_countOptional[int]NoneTarget number of bins.
continuousboolTrueTrue (default) renders bars spanning their full time bin (end-to-end); False uses the built-in fixed pixel-width renderer.
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.