Skip to content

Candlestick

Creates a candlestick (or OHLC bar) chart of financial periods, from rows with a date and open, high, low, and close values. Each row’s date is read by x (default "date"): a Date, a timestamp, or a date string.

Each row is one period with a date, open, high, low, and close (the default keys). The wick runs from the high to the low and the body from the open to the close. Periods that closed at or above their open are drawn as green outlines, and periods that fell are filled red, so direction reads from the fill as well as the color. Hover anywhere over the plot to see the nearest period’s values and its change from open to close.

How each period draws: "candlestick" (default), a wick from the high to the low around a body from the open to the close; or "ohlc", a line from the high to the low with the open ticked to the left and the close ticked to the right.

Draws rising candles as outlines and falling candles filled (default true), so direction reads without relying on color; false fills both. OHLC bars are never filled. An unfilled candle or bar takes no shapeConfig.texture or shapeConfig.backgroundImage; filled ones take both, with a texture's lines a shade darker than the body unless the texture sets its own stroke.

The color of periods that closed at or above their open: a color string, or an accessor of the row. Defaults to green.

The color of periods that closed below their open: a color string, or an accessor of the row. Defaults to red.

The share of each period's room the candle body (or OHLC ticks) spans, from 0 to 1. Defaults to 0.7.

variant: "ohlc" draws each period as an OHLC bar: a line from the high to the low, with the open ticked to the left and the close ticked to the right.

How each period draws: "candlestick" (default), a wick from the high to the low around a body from the open to the close; or "ohlc", a line from the high to the low with the open ticked to the left and the close ticked to the right.

The share of each period's room the candle body (or OHLC ticks) spans, from 0 to 1. Defaults to 0.7.

Point x, open, high, low, and close at your own keys (or accessor functions). hollow: false fills every candle, and upColor/downColor swap the palette, here for a blue/orange pair that stays distinct for red-green color blindness. A yConfig.tickFormat formats the prices in the tooltip as well as on the axis.

Accessor (or data key) for each period's opening value. Defaults to "open"; a row without one opens at its close. Rows that share a series and a period merge into one candle, taking the first row's open (in data order, so sort rows oldest first). Override with an aggs entry on the data key, or, for a function accessor, on "open".

Accessor (or data key) for each period's highest value. Defaults to "high"; the high always reaches the open and close. Merged rows take the highest high; aggs overrides it as it does for open.

Accessor (or data key) for each period's lowest value. Defaults to "low"; the low always reaches the open and close. Merged rows take the lowest low; aggs overrides it as it does for open.

Accessor (or data key) for each period's closing value. Defaults to "close". The close is the chart's y: setting y sets it, rows without one are skipped, and hover snaps to it. Merged rows take the last row's close; aggs overrides it as it does for open.

Draws rising candles as outlines and falling candles filled (default true), so direction reads without relying on color; false fills both. OHLC bars are never filled. An unfilled candle or bar takes no shapeConfig.texture or shapeConfig.backgroundImage; filled ones take both, with a texture's lines a shade darker than the body unless the texture sets its own stroke.

The color of periods that closed at or above their open: a color string, or an accessor of the row. Defaults to green.

The color of periods that closed below their open: a color string, or an accessor of the row. Defaults to red.

volume draws a strip of volume bars under the candles, one per candle in its up or down color, on its own small axis with abbreviated ticks (e.g. 1.2M). The price axis shrinks to make room, the x axis sits under the strip, and the tooltip adds a Volume row. Bars stay filled when candles are hollow, so short bars remain easy to read. volumeConfig sets the strip’s height (a share of the plot, default 0.2), the gap above it, and axisConfig/shapeConfig for its axis and bars. When rows merge, volumes add up; aggs overrides it.

Accessor (or data key) for each period's traded volume. Off by default; when set, a strip under the candles draws one bar per candle, as tall as its volume on the strip's own axis (ticks abbreviated, e.g. "1.2M"), in its candle's up or down color, and the tooltip adds a Volume row. Bars are always filled, hollow candles included, and take shapeConfig.texture and shapeConfig.backgroundImage like filled candles; they hover with their candle. The price axis shrinks to make room, and the x axis sits under the strip. Merged rows add their volumes; an aggs entry overrides it as it does for open. Set false to turn it off.

How each period draws: "candlestick" (default), a wick from the high to the low around a body from the open to the close; or "ohlc", a line from the high to the low with the open ticked to the left and the close ticked to the right.

Draws rising candles as outlines and falling candles filled (default true), so direction reads without relying on color; false fills both. OHLC bars are never filled. An unfilled candle or bar takes no shapeConfig.texture or shapeConfig.backgroundImage; filled ones take both, with a texture's lines a shade darker than the body unless the texture sets its own stroke.

Rows that share a series and a period merge into one candle: the first row’s open, the highest high, the lowest low, and the last row’s close. Rows merge in data order, so sort them oldest first. Here seven hourly rows a day, with x pointed at their day, roll up to daily candles. An aggs entry overrides any of the four, keyed by the data key (or, for a function accessor, by the field name: aggs: {close: (rows, value) => ...}).

const config = {
  data: (() => {
    let seed = 7;
    const random = () => (seed = (seed * 16807) % 2147483647) / 2147483647;
    const round = v => Math.round(v * 100) / 100;
    const rows = [];
    const day = new Date(2024, 0, 1);
    let price = 120,
      n = 0;
    while (n < 30) {
      if (day.getDay() % 6) {
        const date = [day.getFullYear(), day.getMonth() + 1, day.getDate()]
          .map(v => String(v).padStart(2, "0"))
          .join("-");
        for (let hour = 10; hour <= 16; hour++) {
          const open = price;
          price = open * (1 + (random() - 0.49) * 0.012);
          rows.push({
            symbol: "ACME",
            day: date,
            time: date + "T" + hour + ":00",
            open: round(open),
            high: round(Math.max(open, price) * (1 + random() * 0.004)),
            low: round(Math.min(open, price) * (1 - random() * 0.004)),
            close: round(price),
          });
        }
        n++;
      }
      day.setDate(day.getDate() + 1);
    }
    return rows;
  })(),
  groupBy: "symbol",
  x: "day",
};

By default periods are spaced evenly in date order, so weekends and holidays leave no gaps, and the axis ticks the first period of each week, month, quarter, or year. skipGaps: false places each period at its date on a continuous time axis instead, which shows the gaps.

Places periods one slot apart in date order (default true), so days without data (weekends, holidays) leave no gap; false places each period at its date on a continuous time axis, where xConfig.rangeBreaks can hide weekends, holidays, or off-hours.

Two years of daily candles. The Canvas renderer draws dense charts quickly while keeping the snapped tooltip; candles narrow to fit, down to a single pixel.

Selects which @d3plus/render backend paints the visible output. "svg" = SvgRenderer (default), "canvas" = CanvasRenderer. Boolean arguments both normalize to "svg".

Places periods one slot apart in date order (default true), so days without data (weekends, holidays) leave no gap; false places each period at its date on a continuous time axis, where xConfig.rangeBreaks can hide weekends, holidays, or off-hours.

The share of each period's room the candle body (or OHLC ticks) spans, from 0 to 1. Defaults to 0.7.

facet draws one panel per ticker. With facetConfig.scales: "independent", each panel’s value axis fits its own price range.

Splits the chart into small multiples: a grid of equally sized panels, one per distinct value of this data key or accessor, each drawing the chart for that value's rows. The panels share one legend, color scale, title, and timeline, color each series the same way, and hover, tooltips, and legend clicks apply across all of them. Pass false to draw a single chart. See facetConfig for the grid's layout and shared scales.

Configuration

import {Candlestick} from "@d3plus/core";

Extends Plot → Viz.

activefalse | function

The active callback function for highlighting shapes.

aggsobject

Custom aggregation functions keyed by data property.

annotationsunknownDefault unknown

Allows drawing custom shapes to be used as annotations in the provided x/y plot. This method accepts custom config objects for the Shape class, either a single config object or an array of config objects. Each config object requires an additional parameter, the "shape", which denotes which Shape sub-class to use (Rect, Line, etc).

Additionally, each config object can also contain an optional "layer" key, which defines whether the annotations will be displayed in "front" or in "back" of the primary visualization shapes. This value defaults to "back" if not present ("front" for callouts).

Three more kinds draw chart notes: "Callout" anchors wrapped text in a box at each data row's x/y (in data units, or plot-area fractions with xRef/yRef: "plot"), offset by dx/dy pixels and joined to its anchor by a connector ending in an arrowhead or dot (see CalloutAnnotation); "ReferenceLine" and "ReferenceBand" draw what referenceLines and referenceBands entries expand into. All annotations follow zoom and never respond to the pointer or keyboard.

ariaHiddenbooleanDefault true

Hides the SVG from assistive technology when true (aria-hidden).

attributionstring | booleanDefault false

Sets text to be shown positioned absolute on top of the visualization in the bottom-right corner. This is most often used in Geomaps to display the copyright of map tiles. The text is rendered as HTML, so any valid HTML string will render as expected (eg. anchor links work).

attributionIconstring | function

Overrides the "ⓘ" icon a long attribution collapses to (see attribution), which otherwise renders as an inline SVG. Accepts an HTML string — used as the toggle button's content — or a mount function, (el: HTMLElement) => void | (() => void), called once with the button's reserved icon slot so a live component (a React tree via createRoot(el).render(...), or anything else imperative) can be mounted into it. A returned cleanup function runs right before that slot is discarded, which happens whenever the credit's markup regenerates (its text or theme changes), not just once per chart.

attributionStylerecord

CSS key/value pairs used to style the attribution text.

axisHoverboolean | "x" | "y"Default true

Whether hovering a Plot's mark draws a dashed guide from its point to each axis and a badge on that axis with the point's value there, formatted as the tooltip formats that axis's values (the axis's tickFormat when set). "x" or "y" draws them for that direction only (each including its secondary axis). A bar is badged on its value axis only. With a discrete axis, the shared tooltip's crosshair is that axis's guide, and the value axis follows the hovered series' point (or the one nearest the pointer). Defaults to true ("x" on BumpChart, whose y axes label series rather than values, and on Streamgraph, whose y positions name no values).

axisHoverConfigobject

Styles the axisHover guides and badges. guideConfig takes stroke (the hovered mark's color by default), strokeWidth (default 1), strokeDasharray (default "4 3"), and strokeOpacity. badgeConfig takes fill (the hovered mark's color by default), fontColor (a color contrasting the fill by default), fontFamily, fontSize (default 12), fontWeight (default 400), padding around the text (default 4), and rx corner radius (default 2). Each is a value or a (d, i) => value accessor of the hovered data row.

axisPersistbooleanDefault unknown

Determines whether the x and y axes should have their scales persist while users filter the data, the timeline being the prime example (set this to true to make the axes stay consistent when the timeline changes).

backControlClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the back button, alongside its fixed back-control class. Setting this automatically disables d3plus's built-in inline backControlStyle default (as long as you haven't already customized it yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.

backControlStylerecord | false

An object containing CSS key/value pairs that is used to style the back button. Passing false will remove all default styling. Automatically skipped (as if false) once .backControlClassName(...) is set, unless you've explicitly customized this yourself.

backgroundConfigrecordDefault {duration: 0, fill: transparent}

A d3plus-shape configuration Object used for styling the background rectangle of the inner x/y plot (behind all of the shapes and gridlines).

bodyWidthnumberDefault 0.7

The share of each period's room the candle body (or OHLC ticks) spans, from 0 to 1. Defaults to 0.7.

bufferboolean | recordDefault assign({}, defaultBuffers, {Bar: false, Line: false})

Determines whether or not to add additional padding at the ends of x or y scales. The most commone use for this is in Scatter Plots, so that the shapes do not appear directly on the axis itself. The value provided can either be true or false to toggle the behavior for all shape types, or a keyed Object for each shape type (ie. {Bar: false, Circle: true, Line: false}).

cachebooleanDefault true

Whether the chart keeps the files it fetches for data, links, nodes, topojson, and fitObject. Each chart has its own cache of its 10 most recent requests, keyed by the request (the URL, and a request object's fetch options), so loaders naming the same URL share one request. It holds each response as fetched, before its *Format formatter runs, so setting the same URL again, or a new formatter, draws from the cache without a request. A failed request is not kept. Defaults to true; set it to false to fetch on every load, or use dataPollingInterval to re-fetch data on a schedule (polls always fetch).

classNamestring | array.&lt;string&gt; | undefined

CSS classes added to the outermost element this chart or component draws into, next to its fixed d3plus classes, so page CSS can target it: a chart's root <svg class="d3plus-viz"> (its <canvas> with the Canvas renderer) and a standalone component's <svg>. Takes a space-separated string or an array. A new value replaces the classes the previous one added; unset adds none. Tooltips take their own tooltipConfig.className.

closestring | functionDefault "close"

Accessor (or data key) for each period's closing value. Defaults to "close". The close is the chart's y: setting y sets it, rows without one are skipped, and hover snaps to it. Merged rows take the last row's close; aggs overrides it as it does for open.

colorstring | false | function

Defines the main color to be used for each data point in a visualization. Can be either an accessor function or a string key to reference in each data point. If a color value is returned, it will be used as is. If a string is returned, a unique color will be assigned based on the string.

When the color is a category that isn't one of the groupBy levels (for example, points grouped by "country" and colored by "region"), the legend shows one entry per category, labelled by the category. Clicking, shift+clicking, or hovering an entry hides, solos, or highlights every item in that category.

colorDefaultscolordefaultsconfig

Overrides the default colors used when assigning fills from data and choosing legible text colors: dark and light (the text colors picked for contrast against a background), missing (null/undefined values), on/off (true/false values), sequential (the anchor hue for magnitude ramps), and scale (the categorical palette, given as a d3 ordinal scale or an array of colors). Keys are merged into the current defaults, and a Viz passes its overrides down to the shapes and components it draws.

colorOrdinalbooleanDefault false

Treat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues.

colorScalestring | false | function

Defines the value to be used for a color scale. Can be either an accessor function or a string key to reference in each data point.

colorScaleConfigobject

A pass-through to the config method of ColorScale.

colorScaleMaxSizenumberDefault 600

The maximum pixel size for drawing the color scale: width for horizontal scales and height for vertical scales.

colorScalePaddingboolean | function

Tells the colorScale whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the colorScale appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

colorScalePositionfalse | panelposition | function

Defines which side of the visualization to anchor the color scale. Acceptable values are "auto" (the default), "top", "bottom", "left", "right", and false. "auto" lets the chart choose: inside the chart when it fits there (see legendInset), otherwise the right side of charts more than 1.5 times as wide as they are tall and the bottom of all others. Any other side keeps the color scale there. A false value will cause the color scale to not be displayed, but will still color shapes based on the scale.

configd3plusconfig

Methods that correspond to the key/value pairs and returns this class.

connectGapsconnectgapsDefault true

How a line crosses a missing value: a step of the discrete axis that another line has and this one skips, or a row whose value is null or NaN. true (the default) or "solid" draws the line straight on through it. false breaks the line there, leaving the gap empty. "dashed" breaks the line and bridges the gap with a short dash ("2 4") in the line's color, distinct from a forecast's longer dash. An object styles the bridge: stroke (default the line's color), strokeDasharray (default "2 4"; false for a solid bridge), strokeWidth (default the line's width), and opacity (default 1). A bridge follows the line's curve, since it is drawn along the same path, and is decoration only: it has no tooltip, takes no keyboard focus, and a shared tooltip at a missing step lists no value for that line. Confidence bands are clipped to the stretches between gaps. A point with a gap on both sides draws no line of its own, so turn on lineMarkers to show it. Areas, including stacked ones, are drawn as before.

crosshairConfigrecordDefault
function
{stroke: () => themed(this._theme, (t) => t.textMuted, colorGray.500), strokeDasharray: 4 3, strokeWidth: 1}

Paint for the shared tooltip's crosshair guide line (stroke, strokeWidth, strokeDasharray, strokeOpacity, …). Merged into the current config.

datastring | array.&lt;datapoint&gt; | object

The primary data array used to draw the visualization. The value passed should be an Array of objects or a String representing a filepath or URL to be loaded. The following filetypes are supported: csv, tsv, txt, and json.

If your data URL needs specific headers to be set, an Object with a "url" and "headers" (or any other fetch request option) may also be passed. An Object with any other key is a data row, not a request.

To transform the data before it is drawn (for example, a JSON API that returns its headers split from its values), set dataFormat. Passing a formatter as a second argument to this method sets dataFormat; calling it with only data keeps the current dataFormat.

To re-fetch a URL on an interval and redraw when its data changes, set dataPollingInterval; each poll runs dataFormat.

Defaults to an empty array ([]).

dataCutoffnumberDefault 100

Maximum number of data points to render before downsampling.

dataFormatfunction

Transforms data before it is drawn. The function receives the loaded file (or the parsed JSON response, or an Array of them when data lists several URLs), or the Array passed as data, and returns the rows to draw. It may instead return a config object holding the rows as its data key, and the rest of that object is applied to the chart, so a response can set options such as title from what it contains.

It runs when the chart renders, whichever order data and dataFormat are set in, and setting it again re-runs it on the next render, over the cached response (see cache). Every dataPollingInterval poll runs it too. Passing a formatter as the second argument of data(url, format) sets it, and setting data alone keeps it.

dataPollingIntervalnumber | falseDefault false

When data is loaded from a URL (or a request object, or an Array holding one), re-fetches it every this many milliseconds and redraws with a transition when it changes, keeping hover, zoom, legend toggles, and the timeline selection. Each poll uses the same request and dataFormat as the first load, and a response identical to the drawn data is not redrawn. Polling waits while the browser tab is hidden or, with detectVisible, while the chart is scrolled out of view, and catches up as soon as it is visible again. A failed request keeps the last data, logs one warning per run of failures, and tries again on the next tick. destroy(), setting this to false, or passing new data stops polling. Only data is polled, not links, nodes, or topojson. Defaults to false (load once).

depthnumber

Active depth level for nested groupings.

detectResizebooleanDefault true

If the width and/or height of a Viz is not user-defined, it is determined by the size of it's parent element. When this method is set to true, the Viz will listen for the window.onresize event and adjust it's dimensions accordingly.

detectResizeDelaynumberDefault 400

When resizing the browser window, this is the millisecond delay to trigger the resize event.

detectVisiblebooleanDefault true

Toggles whether or not the Viz should try to detect if it visible in the current viewport. When this method is set to true, the Viz will only be rendered when it has entered the viewport either through scrolling or if it's display or visibility is changed.

detectVisibleIntervalnumberDefault 1000

The interval, in milliseconds, for checking if the visualization is visible on the page. When detectVisible defers a render until the visualization scrolls into view, this is also how long it must stay in view before it renders, so visualizations scrolled past quickly are never drawn.

detectVisibleUnloadbooleanDefault true

When true (the default) and detectVisible is enabled, the Viz releases its DOM and scene while it is scrolled out of view and redraws when it returns, keeping the page light when there are many visualizations. Data and configuration are retained; interaction state such as zoom or selection is not, so set this to false to keep it. With detectVisible enabled, each chart's <svg> is also given content-visibility: auto, so the browser skips rendering its contents while it is far off-screen (this matters most when this is false and charts are kept). For a larger saving you can also apply content-visibility: auto and a contain-intrinsic-size to the container element yourself; that adds paint containment to an element you own, so it is not done automatically. Requires IntersectionObserver.

downColorstring | functionDefault #e03131

The color of periods that closed below their open: a color string, or an accessor of the row. Defaults to red.

durationnumberDefault 600

Default duration of transitions, in milliseconds.

facetstring | false | function

Splits the chart into small multiples: a grid of equally sized panels, one per distinct value of this data key or accessor, each drawing the chart for that value's rows. The panels share one legend, color scale, title, and timeline, color each series the same way, and hover, tooltips, and legend clicks apply across all of them. Pass false to draw a single chart. See facetConfig for the grid's layout and shared scales.

facetConfigfacetconfig

Configuration for small multiples (see facet), merged into the current config: - columns / rows: the grid's shape. Chosen by default to make the panels as large as the chart's shape allows. - padding: the space between panels, in pixels (default 20). - sort: panel order — "ascending" (default), "descending", "data" (first appearance), a comparator over facet values, or an Array of values. - scales: "shared" (default) gives every panel of a chart with axes the same x/y domains; "independent" fits each panel to its own rows. Funnel defaults to "independent" (each panel sized to its own widest stage); "shared" sizes every panel against the widest stage across all panels. PolarArea and RadialBar default to "independent" (each panel's rings and ticks fit its own values); "shared" gives every panel the same value domain. - axes: with shared scales, "outer" (default) labels the axes only along the grid's left and bottom edges; "all" labels every panel. An object sets each axis on its own, as in {x: "all", y: "outer"}: every panel labels its x axis, only the left column labels its y axis, and the panels' plot areas line up. BumpChart defaults to "all", and Marimekko labels its categories on every panel and its 0–100% share axis only along the outer edge, even with independent scales. - title: a (value, data) => string function for each panel's title, or false to hide panel titles. - titleConfig: TextBox config for the panel titles (fontSize, fontWeight, fontColor, textAnchor, padding, …).

fillBetweenboolean | [string|number, string|number] | array.&lt;[string|number, string|number]&gt;Default false

Fills the area between two series' lines, in the color of whichever series is higher, switching color where the lines cross: true fills between the first two series, [a, b] between the series with ids a and b, and a list of [a, b] pairs fills between each pair. The fill follows the lines' curve and leaves pointer events to the lines. Defaults to false.

fillBetweenConfigrecord

Area styles for fillBetween (default {fillOpacity: 0.25}). Style accessors receive a data row of whichever series is higher, with above and below keys naming the higher and lower series, so a fill accessor can color the A > B and B > A regions apart. Like a confidence band, the fill takes texture, textureDefault, backgroundImage, and backgroundImageFit from shapeConfig (or shapeConfig.Area), so a texture accessor that picks a series textures the regions where that series is higher; set them here to style the fill alone, or to false to keep it plain.

filterfalse | function

Predicate filtering which data points are included, or false to disable.

fontFamilystring | array.&lt;string&gt;

The font family used throughout the visualization.

forecastboolean | number | string | date | function

Marks a forecast: the stretch of the discrete axis after it gets a shaded backdrop, a rule at its start, and a translated "Forecast" label, and each line's forecast stretch is dashed (see forecastConfig). A function flags the forecast rows (e.g. d => d.Type === "Predicted"): each line is dashed from its last unflagged point, or throughout when every row is flagged, and the backdrop starts at the earliest of those. "auto" (or true) flags the rows whose confidence bounds spread away from their line. A discrete-axis value (a date or year on a time axis) starts the forecast there. Unset (the default), only a trend line projection (trendLineConfig.projection) is marked, from the last fitted value; false marks nothing, not even a projection. On bar charts the backdrop starts at the edge of the first forecast bar, and bars keep their own styles. Defaults to "auto" on a FanChart.

forecastConfigrecord

Styles for the forecast marker: the backdrop's fill and fillOpacity (default 0.05; fill: false hides it), the rule's stroke, strokeWidth (1), strokeOpacity (0.4), and strokeDasharray ("4 4"; stroke: false hides it), the label's text as label (default "Forecast", translated; false hides it) with fontColor, fontFamily, fontSize (12), fontWeight, and fontOpacity (0.7), and lineDasharray, the dash pattern of each line's forecast stretch (default "6 4"; false keeps lines solid). Colors default to the chart's text color for its background. The backdrop is chart chrome with no data row, so shapeConfig.texture and shapeConfig.backgroundImage leave it plain; give it its own texture (a textures.js name or config, drawn in the backdrop's color over its shade at textureOpacity, default 0.3, with textureDefault) or backgroundImage (a URL, fit by backgroundImageFit, "cover" or "contain"). Both are off by default.

groupBystring | function | array.&lt;string | function&gt;

Defines the mapping between data and shape. The value can be a String matching a key in each data point (default is "id"), or an accessor Function that returns a unique value for each data point. Additionally, an Array of these values may be provided if the visualization supports nested hierarchies.

heightnumber

Overall height of the visualization in pixels.

hiddenColorcsscolor | function

Defines the color used for legend shapes when the corresponding grouping is hidden from display (by clicking on the legend).

hiddenOpacitynumber | function

Defines the opacity used for legend labels when the corresponding grouping is hidden from display (by clicking on the legend).

highstring | functionDefault "high"

Accessor (or data key) for each period's highest value. Defaults to "high"; the high always reaches the open and close. Merged rows take the highest high; aggs overrides it as it does for open.

highlightfalse | function

Persistently emphasizes the data points matching the given predicate: the matching marks keep their color while every other mark is de-emphasized to a neutral gray (the "emphasis" form — highlight one series, gray the rest). Unlike hover/active (transient, opacity-based), highlight is a standing state that survives pointer movement. Pass false to clear it.

hollowbooleanDefault true

Draws rising candles as outlines and falling candles filled (default true), so direction reads without relying on color; false fills both. OHLC bars are never filled. An unfilled candle or bar takes no shapeConfig.texture or shapeConfig.backgroundImage; filled ones take both, with a texture's lines a shade darker than the body unless the texture sets its own stroke.

hoverfalse | function

The hover callback function for highlighting shapes on mouseover.

hoverDistancenumberDefault 20

How close, in pixels, the pointer has to come to a point mark for it to count as hovering that point. Over empty space, or over something other than a point (a gridline, a link), the pointer acts on the closest point whose edge lies within this distance: its tooltip, hover highlight, and axis guides show, and a click there clicks it. A point's tooltip points at the top of the point (on it or near it) and holds still until another point takes over. Applies to the point marks of scatter and bubble plots (Circle and Rect shapes, Beeswarm included), Network nodes, and Geomap points; bars, areas, lines, and other area-filling marks keep exact hit-testing. Plots with a discrete axis and tooltipShared on snap to the nearest column instead. Defaults to 20; 0 turns it off, along with the anchored tooltip.

keyboardNavbooleanDefault true

Lets keyboard users move between the chart's data marks. The chart is one Tab stop (a focusable role="application" element laid over it, named by svgTitle or the chart's title); once it has focus, the arrow keys move to the nearest mark in that direction, Home and End jump to the first and last mark, Enter or Space selects the focused mark as a click would (drilling down, or toggling a legend item), and Escape clears it. The focused mark shows its tooltip and hover highlight, a ring outlines it (see keyboardNavConfig), and a live region announces its label to screen readers. Legend items are included after the chart's marks; Line and Area series are visited point by point. On by default; false removes the Tab stop.

keyboardNavConfigkeyboardnavconfig

Styles the focus ring around the mark keyboard navigation has focused (see KeyboardNavConfig).

labelstring | false | accessorfn | array.&lt;string&gt;

Accessor function, or a constant string applied to every data point's label (unlike value/nodeId/etc., a string here is not treated as a per-datum object key — pass a function for that).

legendboolean | functionDefault false

Whether to display the legend. By default, the legend shows when it has more than one entry and each entry stands for a single group (or two groups at most), or when the entries are colored by a category that isn't a groupBy level (see color), in which case each entry is labelled by its category. Pass false to hide it, true to always show it, or a (config, data) => boolean function to decide.

legendConfigobject

Configuration object passed to the legend's config method.

legendFilterInvertboolean | function

Defines the click functionality of categorical legend squares. When set to false, clicking will hide that category and shift+clicking will solo that category. When set to true, clicking will solo that category and shift+clicking will hide that category. The Back button undoes each click (see legendHistory).

legendHistorybooleanDefault true

Whether legend clicks go on the chart's Back history. A click or shift+click (or Enter or Space on a legend item) that changes what is hidden or solo'd shows the Back button, and Back undoes legend clicks and drill-downs in the order they happened, restoring the legend exactly as it was. A drill-down to a deeper level starts with every group shown, and Back out of it brings back the legend it left. A click that changes nothing adds no step, and new data clears the legend's steps along with the legend. Clicking a Sunburst or Icicle center zooms out without undoing the legend clicks made since the zoom. Defaults to true; false leaves legend clicks off the history, so Back only steps out of drill-downs.

legendInsetboolean | functionDefault true

Whether the chart may draw one of its legends inside the empty space around its marks instead of in a margin, for charts that leave open space around their marks, such as Plot and the charts built on it, Network, Pack, Pie, and Geomap; a chart whose marks fill its area, like Treemap, keeps its legends in the margins. After the chart lays out, the size legend is tried first, then the legend, then the colorScale; the first that fits is drawn over a semi-transparent box (see legendInsetConfig), and any others keep their margins. Space enclosed by the marks, like the middle of a ring of points, is never used. Only a legend or colorScale whose position is "auto" (the default) can move inside; one set to a side stays in that margin. Defaults to true; also accepts a function that receives the resolved chart config and returns a boolean.

legendInsetConfigobject

Style of the box drawn behind a legend placed inside the chart (see legendInset): fill (defaults to the chart's background color), fillOpacity (0.85), stroke (defaults to a faint contrasting line), strokeWidth (1), rx (corner radius, 4), margin (space between the box's edge and the legend, 6), and padding (space kept between the box and the chart's marks and edges, 10).

legendPaddingboolean | function

Tells the legend whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the legend appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

legendPositionfalse | panelposition | function

Defines which side of the visualization to anchor the legend. Expected values are "auto" (the default), "top", "bottom", "left", "right", and false to hide it. "auto" lets the chart choose: inside the chart when it fits there (see legendInset), otherwise the right side of charts more than 1.5 times as wide as they are tall and the bottom of all others. Any other side keeps the legend there.

legendSortfunction

Comparator that orders the legend's entries. By default the legend reads in the order the chart draws: Treemap, Pack, Pie, Donut, Icicle, and Sunburst list their largest entries first; a stacked chart lists its series in stacking order, from the baseline outward (so the default stackOrder, "descending", lists the largest first); Waffle and Waterfall follow their own order, and Network and ArcDiagram clusters come largest first; every other chart is alphabetical by label. A threshold group always comes last, whatever the sort.

legendTooltiptooltipconfig

Configuration object for the legend tooltip.

lineLabelConfiglinelabelconfig

Options for lineLabels. value: true adds the line's value at each labeled end after the series name (e.g. "Brazil 37%"), formatted as the y axis formats its ticks (its tickFormat when set). valueFormat formats it instead, as a function of the value, the row it belongs to, and the row's index. Defaults to {value: false}.

Links this chart to every other chart with the same group name, so hovering, active, highlight (including search), and legend hide/solo clicks in one are mirrored in the rest, and a value gets the same categorical color in every chart. Rows match across charts by the value of by (a data key or accessor), which defaults to the chart's own id. A string is shorthand for {group}; set hover, active, highlight, legend, or color to false to stop sharing that behavior.

loadingHTMLstring | function

The inner HTML of the status message displayed when loading AJAX requests and displaying errors. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.

loadingMessagebooleanDefault true

Toggles the visibility of the status message that is displayed when loading AJAX requests and displaying errors.

localestring | object

The locale used for all text and number formatting. Supports the locales defined in d3plus-format. The locale can be a complex Object, a locale code (like "en-US"), or a 2-digit language code (like "en"). If a 2-digit code is provided, the "findLocale" function is used to identify the most approximate locale.

lowstring | functionDefault "low"

Accessor (or data key) for each period's lowest value. Defaults to "low"; the low always reaches the open and close. Merged rows take the lowest low; aggs overrides it as it does for open.

messageMaskstring | booleanDefault rgba(0, 0, 0, 0.05)

The color of the mask displayed underneath the status message when loading AJAX requests and displaying errors. Set to false to turn off the mask completely.

messageStylerecord

Defines the CSS style properties for the status message that is displayed when loading AJAX requests and displaying errors.

minimapbooleanDefault true

Shows a small overview + draggable-viewport minimap underneath the zoom controls once the chart is zoomed in. On by default whenever zoom is enabled.

minimapClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the minimap's outer box, viewport box, and zoom-level label, alongside their fixed d3plus-minimap / d3plus-minimap-viewport / d3plus-minimap-label classes. Setting this automatically disables d3plus's built-in inline minimapStyle/minimapViewportStyle/minimapViewportStyleActive/minimapLabelStyle defaults (as long as you haven't already customized them yourself), so a host page's own styling applies through the cascade with no other configuration needed.

minimapLabelStylerecord | false

An object containing CSS key/value pairs that is used to style the minimap's zoom-level text label (e.g. "2x"). Passing false will remove all default styling. Automatically skipped (as if false) once .minimapClassName(...) is set, unless you've explicitly customized this yourself.

minimapStylerecord | false

An object containing CSS key/value pairs that is used to style the minimap's outer box (the full-scene overview). Passing false will remove all default styling. Automatically skipped (as if false) once .minimapClassName(...) is set, unless you've explicitly customized this yourself.

minimapViewportStylerecord | false

An object containing CSS key/value pairs that is used to style the minimap's draggable viewport box in its resting state. Passing false will remove all default styling. Automatically skipped (as if false) once .minimapClassName(...) is set, unless you've explicitly customized this yourself.

minimapViewportStyleActiverecord | false

An object containing CSS key/value pairs that is used to style the minimap's draggable viewport box while it's being dragged. Passing false will remove all default styling. Automatically skipped (as if false) once .minimapClassName(...) is set, unless you've explicitly customized this yourself.

noDataHTMLstring | function

The inner HTML of the status message displayed when no data is supplied to the visualization. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.

noDataMessagebooleanDefault true

Toggles the visibility of the status message that is displayed when no data is supplied to the visualization.

onstring

Event listener for the specified event typenames. Mirrors the core d3-selection behavior.

openstring | functionDefault "open"

Accessor (or data key) for each period's opening value. Defaults to "open"; a row without one opens at its close. Rows that share a series and a period merge into one candle, taking the first row's open (in data order, so sort rows oldest first). Override with an aggs entry on the data key, or, for a function accessor, on "open".

parentunknown

Parent config used by the wrapper.

pointLabelConfigpointlabelconfig

Fits and styles circle labels (see labelPosition): fontMin is the smallest font size a label may shrink to inside its circle before "auto" moves it beside the circle (default 10, the size of the chart's smallest text, its total); fontSize is the size of a label beside its circle (default 11); padding is the space between the circle's edge and that label (default 3). The other TextBox keys (fontColor, fontFamily, fontWeight, fontOpacity, …) style the labels beside their circles, which default to the chart's text color. Merged into the current config.

reducedMotion"auto" | booleanDefault auto

Whether the chart animates. "auto" (default) follows the viewer's OS setting, read from the (prefers-reduced-motion: reduce) media query at each draw (server-side rendering counts as not reduced). true always draws without motion: shapes, axes, legends, zooms, and fades jump straight to their final state. false always animates. duration keeps the value you set either way.

referenceBandsarray.&lt;referencebandconfig&gt;Default []

Plot: shaded spans across the plot between two values, such as a recession or a target range. Give each entry x (a vertical band) or y (a horizontal one) as [start, end] in data units (numbers, dates, or categories; on a category axis the band covers each end category's whole slot), or x2/y2 for the secondary axes, or ref: "plot" for fractions of the plot area. An optional label sits inside the band's top-left corner (labelPosition: "end" for the top-right), with fontColor, fontFamily, fontSize, fontWeight, lineHeight, and maxWidth. The fill defaults to the chart's text color at fillOpacity 0.08, so it reads on light and dark themes; stroke, strokeWidth, and strokeOpacity add edges. On a continuous or time axis the band's ends count toward the axis domain, widening it to show the whole band (an end set by xDomain/yDomain/x2Domain/y2Domain or the axis config's domain stays put). Each entry expands into a "ReferenceBand" annotation (see annotations) behind the data (layer: "front" to draw it over; its label always draws above), which follows zoom and never responds to the pointer or keyboard. A label that would cover a data label or another reference label moves to the band's other corners or along its length, inside the plot, and is hidden when no spot is free.

referenceLinesarray.&lt;referencelineconfig&gt;Default []

Plot: lines across the whole plot at one value, such as a target or a launch date. Give each entry x (a vertical line) or y (a horizontal one) in data units (a number, a date, or a category), or x2/y2 for the secondary axes, or ref: "plot" for a fraction of the plot area. An optional label sits at the line's "end" (the right of a horizontal line, the top of a vertical one) or "start" (labelPosition), with fontColor, fontFamily, fontSize, fontWeight, lineHeight, and maxWidth. The line's stroke defaults to the chart's text color at strokeOpacity 0.6, strokeWidth 1; dash: true dashes it ("4 4"), or give a dash pattern. On a continuous or time axis the value counts toward the axis domain, widening it to show the line (an end set by xDomain/yDomain/ x2Domain/y2Domain or the axis config's domain stays put; a value outside such a domain is not drawn). Each entry expands into a "ReferenceLine" annotation (see annotations) behind the data (layer: "front" to draw it over; its label always draws above), which follows zoom and never responds to the pointer or keyboard. A label that would cover a data label or another reference label moves to the line's other side or end, or along it, inside the plot, and is hidden when no spot is free.

renderfunction

Draws the visualization given the specified configuration.

rendererboolean | "svg" | "canvas"

Selects which @d3plus/render backend paints the visible output. "svg" = SvgRenderer (default), "canvas" = CanvasRenderer. Boolean arguments both normalize to "svg".

saveControlbooleanDefault true

Shows a top-left download button that saves the chart, as the reader sees it, as a PNG, SVG, or JPG file. On by default for every chart.

saveControlClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the download button, alongside the fixed save-control/save-toggle classes. Setting this automatically disables d3plus's built-in inline saveControlStyle/saveControlStyleActive/saveControlStyleHover defaults (as long as you haven't already customized them yourself), so a host page's own button styling applies through the cascade with no other configuration needed.

saveControlConfigsavecontrolconfig

Options for the download button: the saved file's filename, the formats it offers, the background painted behind the chart, a callback, and html-to-image options for PNG and JPG files.

saveControlMenuClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the download menu, alongside its fixed d3plus-save-menu class (each item has the fixed save-menu-item class). Setting this automatically disables d3plus's built-in inline saveControlMenuStyle/saveControlMenuItemStyle/saveControlMenuItemStyleHover defaults (as long as you haven't already customized them yourself), so a host page's own menu styling applies through the cascade. The menu's position and open/closed display stay inline.

saveControlMenuItemStylerecord | false

An object containing CSS key/value pairs that is used to style each item in the download menu. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlMenuClassName(...) is set, unless you've explicitly customized this yourself.

saveControlMenuItemStyleHoverrecord | false

An object containing CSS key/value pairs that is used to style the download menu item under the pointer or keyboard focus. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlMenuClassName(...) is set, unless you've explicitly customized this yourself.

saveControlMenuStylerecord | false

An object containing CSS key/value pairs that is used to style the download menu: its background, border, shadow, and spacing. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlMenuClassName(...) is set, unless you've explicitly customized this yourself.

saveControlStylerecord | false

An object containing CSS key/value pairs that is used to style the download button. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlClassName(...) is set, unless you've explicitly customized this yourself.

saveControlStyleActiverecord | false

An object containing CSS key/value pairs that is used to style the download button while its menu is open. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlClassName(...) is set, unless you've explicitly customized this yourself.

saveControlStyleHoverrecord | falseDefault false

An object containing CSS key/value pairs that is used to style the download button on hover. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlClassName(...) is set, unless you've explicitly customized this yourself.

scrollContainerstring | htmlelement | window

If using scroll or visibility detection, this method allow a custom override of the element to which the scroll detection function gets attached.

Shows a top-left search button that expands into an input; typing highlights shapes whose label matches. On by default for every chart.

searchAccessorfunction

Resolves the string the search box matches its typed term against, for a given datum. Defaults to the mark's resolved on-screen label (viz._drawLabel) — the same text the user reads on the chart. Override it to match against something else instead, e.g. a data field that isn't shown as the label.

This is checked alongside, not instead of, every level of the datum's own groupBy hierarchy — searching a leaf's label also matches its ancestor group's cell/legend entry, and vice versa, regardless of this accessor's override.

searchControlClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the search toggle button and input, alongside their fixed search-control classes. Setting this automatically disables d3plus's built-in inline searchControlStyle/searchControlStyleActive/searchControlStyleHover defaults (as long as you haven't already customized them yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.

searchControlStylerecord | false

An object containing CSS key/value pairs that is used to style the search toggle button. Passing false will remove all default styling. Automatically skipped (as if false) once .searchControlClassName(...) is set, unless you've explicitly customized this yourself.

searchControlStyleActiverecord | false

An object containing CSS key/value pairs that is used to style the search toggle button while open. Passing false will remove all default styling. Automatically skipped (as if false) once .searchControlClassName(...) is set, unless you've explicitly customized this yourself.

searchControlStyleHoverrecord | falseDefault false

An object containing CSS key/value pairs that is used to style the search toggle button on hover. Passing false will remove all default styling. Automatically skipped (as if false) once .searchControlClassName(...) is set, unless you've explicitly customized this yourself.

selectstring | htmlelement

The SVG container element as a d3 selector or DOM element. Defaults to undefined.

shapeConfigd3plusconfig

Configuration object with key/value pairs applied as method calls on each shape.

shapeSortfunction

A sort comparator that receives each shape class (e.g. "Circle", "Line") as its arguments. Shapes are drawn in groups by type, so this defines the layering order for all shapes of a given type.

sizeZerobooleanDefault false

Anchors a Plot's size scale at zero, so a mark's size is proportional to its value: with the default sizeScale of "sqrt", each circle's area is (a value twice as large draws a circle with twice the area), and with "linear", its radius. The largest value still draws at sizeMax, while sizeMin no longer sets the smallest mark's radius, so values near zero draw as small as they are. Off by default, except on BubbleChart. Ignored when any size is negative or sizeScale is "log".

skipGapsbooleanDefault true

Places periods one slot apart in date order (default true), so days without data (weekends, holidays) leave no gap; false places each period at its date on a continuous time axis, where xConfig.rangeBreaks can hide weekends, holidays, or off-hours.

subtitlestring | function

Accessor function or string for the visualization's subtitle.

subtitleConfigrecord

Configuration object for the subtitle.

subtitlePaddingboolean | function

Tells the subtitle whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the subtitle appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

svgDescstring

Accessible description applied to the root SVG (<desc>).

svgTitlestring

Accessible title applied to the root SVG (<title>).

tableViewbooleanDefault true

Enables the top-left table-view toggle button, which swaps the chart for a static, scrollable <table> of its data. On by default for every chart.

tableViewClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the <table> element the table-view toggle renders, alongside the fixed d3plus-table-view-table class. Lets a host page style the data table with its own table styling (Tailwind, Bootstrap, a design system) via descendant selectors.

tableViewControlClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the table-view toggle button, alongside the fixed table-view-control/table-view-toggle classes. Setting this automatically disables d3plus's built-in inline tableViewControlStyle/tableViewControlStyleActive/tableViewControlStyleHover defaults (as long as you haven't already customized them yourself), so a host page's own button styling applies through the cascade with no other configuration needed.

tableViewControlStylerecord | false

An object containing CSS key/value pairs that is used to style the table-view toggle button. Passing false will remove all default styling. Automatically skipped (as if false) once .tableViewControlClassName(...) is set, unless you've explicitly customized this yourself.

tableViewControlStyleActiverecord | false

An object containing CSS key/value pairs that is used to style the table-view toggle button while it is active (showing the data table). Passing false will remove all default styling. Automatically skipped (as if false) once .tableViewControlClassName(...) is set, unless you've explicitly customized this yourself.

tableViewControlStyleHoverrecord | falseDefault false

An object containing CSS key/value pairs that is used to style the table-view toggle button on hover. Passing false will remove all default styling. Automatically skipped (as if false) once .tableViewControlClassName(...) is set, unless you've explicitly customized this yourself.

tableViewDownloadbooleanDefault true

Whether the data table shows a "download CSV" button, exporting its full (sorted, unpaginated) rows. On by default.

tableViewPageSizenumber | falseDefault 50

The number of data-table rows shown per page while in table view. Set to false (or any non-positive number) to disable pagination and show every row on one page.

tableViewSortbooleanDefault true

Whether the data table's column headers are clickable to sort (toggling asc/desc). On by default.

themethemesettingDefault auto

The chart's colors. "auto" (the default) paints no background and follows the page behind the chart: its chrome text contrasts with the page, its tooltip, table view, and overlays turn dark on a dark page, and it redraws when the page flips between light and dark. "light" and "dark" paint the theme's background behind the chart (so it reads the same on any page, and in a saved image) and take every chrome color from the theme. An object sets your own tokens on top of the preset its base names ("light" or "dark"), for example {base: "dark", background: "#123", accent: "#ffd43b"}. A dark theme also turns color scale ramps around, from a dim tint near the background up to a bright pole (see the colorScale tokens). Colors you set in the other config (titleConfig.fontColor, tooltipConfig, colorScaleConfig.colorMax, the *Style options, …) win over the theme.

thresholdnumber | function

The threshold value for bucketing small data points together, as a share of the total. On a stacked Plot, the series whose summed value across every position is under that share of the whole chart's total merge into one series, stacked on top. A bucket needs at least two items, and its tooltips list them. Off (0) by default on Plot charts.

thresholdKeystring | function

Accessor for the value used in the threshold algorithm. A stacked Plot defaults to its stacked value.

thresholdNamestring | function

Label for the threshold group, or a (datum, index) accessor.

timestring | false | function

Accessor function or string key for the time dimension of each data point.

timeFilterfalse | function

Predicate filtering which time slices are shown, or false to disable. With time set and no timeFilter, a chart starts on its latest period, or on timelineDefault/timelineConfig.selection; setting it starts the chart (and its timeline) on the periods it keeps. A viewer's pick on the timeline replaces it.

timelinebooleanDefault false

Whether to show the timeline component.

timelineConfigtimelineconfig

Configuration object for the timeline.

timelineDefaultstring | date | array.&lt;string | date&gt;

The starting time or range for the timeline, which the chart starts on too. Can be a single Date/String, or an Array of 2 values representing the min and max. A viewer's pick on the timeline replaces it.

timelinePaddingboolean | function

Tells the timeline whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the timeline appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

titlestring | function

Accessor function or string for the visualization's title.

titleConfigrecord

CSS style configuration for the title.

titlePaddingboolean | function

Tells the title whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the title appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

tooltipboolean | function

Whether to show tooltips, or a (datum, index) accessor deciding per mark.

tooltipConfigtooltipconfigDefault {tbody: (d: DataPoint, i: number) => candleTooltipRows(viz, d, i)}

Configuration for the tooltip component.

tooltipSharedbooleanDefault true

Whether hovering a Plot's plot area shows one tooltip listing every series' value at the nearest discrete-axis position, with a crosshair through it. Applies when a discrete axis is set and at least two series share that position.

totalstring | boolean | function

Accessor function or string key for the total value displayed in the visualization.

totalConfigrecord

Configuration object for the total bar.

totalFormatfunction

Formatter function for the value in the total bar.

totalPaddingboolean | function

Tells the total whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the total appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

translatefunction

Defines how informational text strings should be displayed. By default, this function will try to find the string in question (which is the first argument provided to this function) inside of an internally managed translation Object. If you'd like to override to use custom text, simply pass this method your own custom formatting function.

upColorstring | functionDefault #2f9e44

The color of periods that closed at or above their open: a color string, or an accessor of the row. Defaults to green.

variant"candlestick" | "ohlc"Default candlestick

How each period draws: "candlestick" (default), a wick from the high to the low around a body from the open to the close; or "ohlc", a line from the high to the low with the open ticked to the left and the close ticked to the right.

volumestring | false | function

Accessor (or data key) for each period's traded volume. Off by default; when set, a strip under the candles draws one bar per candle, as tall as its volume on the strip's own axis (ticks abbreviated, e.g. "1.2M"), in its candle's up or down color, and the tooltip adds a Volume row. Bars are always filled, hollow candles included, and take shapeConfig.texture and shapeConfig.backgroundImage like filled candles; they hover with their candle. The price axis shrinks to make room, and the x axis sits under the strip. Merged rows add their volumes; an aggs entry overrides it as it does for open. Set false to turn it off.

volumeConfigobjectDefault {height: 0.2, gap: 16, axisConfig: {}, shapeConfig: {fillOpacity: 0.5}}

The volume strip's layout and styling: height, its height as a share of the plot's (default 0.2; pixels when above 1; at most half the plot); gap, the pixels between the candles and the strip (default 16); axisConfig, Axis config for the strip's value axis; and shapeConfig, Path config for the bars (default {fillOpacity: 0.5}).

widthnumber

Overall width of the visualization in pixels.

xplotaccessorargDefault
function
d => d["x"]

Accessor function or string key for the x-axis value of each data point.

x2plotaccessorargDefault
function
d => d["x2"]

Accessor function or string key for the secondary x-axis value of each data point.

x2ConfigrecordDefault {}

A pass-through to the underlying Axis config used for the secondary x-axis. Includes additional functionality where passing "auto" as the value for the scale method will determine if the scale should be "linear" or "log" based on the provided data.

x2Domainarray.&lt;number | date&gt;

The x2 domain as an array. If either value is undefined, it is calculated from the data.

x2Sortfunction

Defines a custom sorting comparator function for discrete x2 axes.

xBreak[number, number] | array.&lt;[number, number]&gt;

Value range(s) to remove from the x axis — [start, end] or a list of them — drawn as a break in the axis with a gap cut across the shapes that cross it (see the axis break and breakConfig).

xConfigrecordDefault
function
{gridConfig: {stroke: (d) => {
  if (this.schema.discrete?.charAt(0) === "x" || this._swarm?.cross === "x") return "transparent";
  const range = this._xAxis.range();
  const position = this._xAxis._getPosition.bind(this._xAxis)(d.id);
  if (range[0] === position) return "transparent";
  return chartGridline(this);
}}}

A pass-through to the underlying Axis config used for the x-axis. Includes additional functionality where passing "auto" as the value for the scale method will determine if the scale should be "linear" or "log" based on the provided data.

xCutoffnumberDefault 150
xDomainarray.&lt;string | number | date&gt;

The x domain as an array. On a continuous axis it is [min, max]. Setting just one end ([min] or [undefined, max]) pins only that end: the data fills the other, rounded where the axis would round it with no domain set (left at the data when xConfig's rounding is "none"; time axes aren't rounded). With both ends set, neither is rounded. On a discrete axis it lists the categories to show, in order; data in other categories is not drawn. A full xConfig domain is the lower-level override: it wins over this, and is drawn exactly as given (rounded only by xConfig's own rounding), without stretching to the chart's baseline.

xSortfunction

Custom sort function for x-axis values.

yplotaccessorargDefault
function
d => d["y"]

Accessor function or string key for the y-axis value of each data point.

y2plotaccessorargDefault
function
d => d["y2"]

Accessor function or string key for the secondary y-axis value of each data point.

y2ConfigrecordDefault {}

A pass-through to the underlying Axis config used for the secondary y-axis. Includes additional functionality where passing "auto" as the value for the scale method will determine if the scale should be "linear" or "log" based on the provided data.

y2Domainarray.&lt;number | date&gt;

The y2 domain as an array. If either value is undefined, it is calculated from the data.

y2Sortfunction

Defines a custom sorting comparator function for discrete y2 axes.

yBreak[number, number] | array.&lt;[number, number]&gt;

Value range(s) to remove from the y axis — [start, end] or a list of them, e.g. [100, 900] to fit one outlier bar — drawn as a break in the axis with a gap cut across the shapes that cross it (see the axis break and breakConfig).

yConfigrecordDefault
function
{gridConfig: {stroke: (d) => {
  if (this.schema.discrete?.charAt(0) === "y" || this._swarm?.cross === "y") return "transparent";
  const range = this._yAxis.range();
  const position = this._yAxis._getPosition.bind(this._yAxis)(d.id);
  if (range[range.length - 1] === position) return "transparent";
  return chartGridline(this);
}}}

A pass-through to the underlying Axis config used for the y-axis. Includes additional functionality where passing "auto" as the value for the scale method will determine if the scale should be "linear" or "log" based on the provided data.

Note: If a "domain" array is passed to the y-axis config, it will be reversed.

yCutoffnumberDefault 150
yDomainarray.&lt;string | number | date&gt;

The y domain as an array. On a continuous axis it is [min, max]. Setting just one end ([min] or [undefined, max]) pins only that end: the data fills the other, rounded where the axis would round it with no domain set (left at the data when yConfig's rounding is "none"; time axes aren't rounded). With both ends set, neither is rounded. On a discrete axis it lists the categories to show, in order; data in other categories is not drawn. A full yConfig domain is the lower-level override: it wins over this, and is drawn exactly as given (rounded only by yConfig's own rounding), without stretching to the chart's baseline.

ySortfunction

Custom sort function for y-axis values.

zoombooleanDefault true

Enables pan/zoom with zoom-control buttons. On by default for every chart.

zoomBrushHandleSizenumberDefault 1

The pixel stroke-width of the zoom brush area.

zoomBrushHandleStylerecord | false

An object containing CSS key/value pairs that is used to style the outer handle area of the zoom brush. Passing false will remove all default styling.

zoomBrushSelectionStylerecord | false

An object containing CSS key/value pairs that is used to style the inner selection area of the zoom brush. Passing false will remove all default styling.

zoomControlClassNamestring

An additional CSS class name (or space-separated list of class names) applied to each zoom control button, alongside the fixed zoom-control / zoom-in / zoom-out / zoom-reset / zoom-brush classes. Setting this automatically disables d3plus's built-in inline zoomControlStyle/zoomControlStyleActive/zoomControlStyleHover defaults (as long as you haven't already customized them yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.

zoomControlIconspartial

Overrides one or more of the four built-in zoom-control icons (zoomIn, zoomOut, zoomReset, zoomBrush), which otherwise render as inline SVGs. Each value is either an HTML string — used as the button's content in place of the built-in icon — or a mount function, (el: HTMLElement) => void | (() => void), called once with the button's reserved icon slot (a 12x12px element) so you can mount anything imperative into it: a React tree (createRoot(el).render(<Icon/>)), a Vue app, a canvas sprite, a brand <img>. Return a cleanup function from the mount function if there's teardown to do; it runs right before that slot is discarded — which happens whenever the whole button panel's markup regenerates (a .locale(...) change, a zoomControlClassName change, or the brush toggle switching), not just once per chart.

zoomControlStylerecord | false

An object containing CSS key/value pairs that is used to style each zoom control button (.zoom-in, .zoom-out, .zoom-reset, and .zoom-brush). Passing false will remove all default styling. Automatically skipped (as if false) once .zoomControlClassName(...) is set, unless you've explicitly customized this yourself.

zoomControlStyleActiverecord | false

An object containing CSS key/value pairs that is used to style each zoom control button when active (.zoom-in, .zoom-out, .zoom-reset, and .zoom-brush). Passing false will remove all default styling. Automatically skipped (as if false) once .zoomControlClassName(...) is set, unless you've explicitly customized this yourself.

zoomControlStyleHoverrecord | falseDefault false

An object containing CSS key/value pairs that is used to style each zoom control button on hover (.zoom-in, .zoom-out, .zoom-reset, and .zoom-brush). Passing false will remove all default styling. Automatically skipped (as if false) once .zoomControlClassName(...) is set, unless you've explicitly customized this yourself.

zoomFactornumberDefault 2

Multiplier applied to programmatic zoom steps.

zoomMaxnumber

Maximum zoom scale factor. Defaults to the scale at which the smallest shape fills the chart area.

zoomPaddingnumberDefault 20

A pixel value to be used to pad all sides of a zoomed area.

zoomPanbooleanDefault true

Whether panning (drag) is enabled while zoomed.

zoomScrollboolean | "modifier"Default modifier

Whether the mouse wheel (and one-finger touch) zooms. "modifier" (the default) leaves page scrolling alone: only Ctrl/⌘ + wheel or a trackpad/two-finger pinch zooms, and one finger pans only once zoomed in. true zooms on any wheel; false never does.