Features · mark

Draw order / z-index

native

Control series stacking order

Matrix status native. Verification render · strong. ChartKit option: ChartKitChartSpecV1.encoding.y.z, ChartKitChartSpecV1.annotations.z.

encoding.y[].z and annotations[].z. Higher paints later. Stacked series keep data order. z below 0 paints an annotation under the marks. zIndex repairs to z (CK3064).

Source: chartkit:packages/core/src/renderers/cartesian.ts

ChartKit spec

Passed validate() during npm run matrix:refresh. The SVG is the server render.

Units stay above the other series.Units stay above the other series.unitsotherFloor102030405060Q1Q2
{
  "version": "1",
  "type": "line",
  "data": [
    {
      "quarter": "Q1",
      "units": 40,
      "other": 22
    },
    {
      "quarter": "Q2",
      "units": 55,
      "other": 18
    }
  ],
  "encoding": {
    "x": "quarter",
    "y": [
      {
        "field": "units",
        "z": 2
      },
      {
        "field": "other",
        "z": 0
      }
    ]
  },
  "a11y": {
    "alt": "Units stay above the other series."
  },
  "size": {
    "width": 640,
    "height": 260
  },
  "annotations": [
    {
      "type": "rule",
      "axis": "y",
      "value": 30,
      "z": -1,
      "label": "Floor"
    }
  ]
}

Other libraries

Option names are the paths recorded in the matrix. A grep-only cell names the identifier that matched, not a render test. Markdown copy: mark.zindex.md.

LibraryStatusOptionVerificationSource
Chart.jsnativeChartConfiguration.data.datasets.ordertypes · strongchart.js/dist/types/index.d.ts:83
Rechartsnativegrep: zIndexZIndexLayer (v3)grep · weakrecharts/types/index.d.ts:130
Apache EChartsnativeseries.z, series.zleveltypes · strongecharts/types/dist/shared.d.ts:8228
HighchartsnativeplotOptions.series.zIndextypes · stronghighcharts/options/series.d.ts:1377
Plotly.jspartialgrep: ordertrace ordergrep · weak@types/plotly.js/index.d.ts:239
NivonativeLine.layerstypes · strong@nivo/line/dist/types/types.d.ts:171
VictorypartialVictoryChartchild ordertypes · strongvictory-chart/lib/victory-chart.d.ts:3
visxpartialGrouptypes · strong@visx/group/lib/Group.d.ts:15
ApexChartsunknown—conflict · unknown—
Tremor (npm)none—absence · absence—
Observable Plotpartialmarksmark ordertypes · strong@observablehq/plot/src/mark.d.ts:496
Vega-Litepartialgrep: layergrep · weak579: "description"
AG Chartspartialgrep: zIndexgrep · weakag-charts-community/dist/types/src/module-support.d.ts:98
amCharts 5nativegrep: zIndexgrep · weak@amcharts/amcharts5/.internal/charts/xy/axes/Axis.d.ts:218
Google Chartsnone—absence · absence—
uPlotpartialOptions.seriesseries ordertypes · stronguplot/dist/uPlot.d.ts:375
TradingView Lightweight Chartsnativegrep: zOrdergrep · weak2182: * @returns the desired position in the visual layer stack. @see {@link PrimitivePaneViewZOrder}
MUI X Chartspartialgrep: zIndexgrep · weak@mui/x-charts/index.d.ts:29
Mermaid (chart-ish diagrams only)none—absence · absence—
AntV G2nativegrep: zIndexgrep · weak@antv/g2/lib/component/axis.d.ts:6