Stacked zeros · library comparisons

Each demo uses the same raw dataset and colors as the zero-run example in the uPlot stacking demo.

Each demo shows the raw series and their negatives. On each side of zero, A is the base and D is the outer layer.

Most pages show both stacks on one Y axis from −16 to 16. Pages marked “two panels” show one stack per chart, with Y ranges of 0 to 16 and −16 to 0.

All plots start at X = 0–20 and use linear paths, 3px strokes, and 18% fill opacity. Each library supplies its own legend, except D3, which has none. uPlot keeps its native cursor and drag zoom.

  1. uPlot — local build
  2. Chart.js 4.6.1
  3. ECharts 6.1.0
  4. D3 7.9.0
  5. ApexCharts 8.4.1 · two panels
  6. Highcharts 13.1.1
  7. Plotly.js 4.1.2
  8. Recharts 3.10.1 (React 19.3.1)
  9. AG Charts Community 14.2.0
  10. amCharts 5.21.4
  11. Google Charts — frozen release 52 · two panels
  12. Vega 6.4.0
  13. AntV G2 5.4.8
  14. billboard.js 4.1.3 · two panels
  15. dygraphs 2.2.2 · two panels
  16. MUI X Charts 9.16.0
  17. Nivo 0.99.0 · two panels
  18. Victory 38.1.1
  19. CanvasJS 3.17.8 · two panels
  20. Bokeh 3.10.1

What to compare

uPlot draws strokes in reverse group.series order within each native band group with dir: 1 or -1. Here, strokes paint from D to A. Fills, points, and hooks keep their existing order. Unstacked series, explicit bands, and dir: 0 bars keep their stroke order.

The examples keep native paint order and stroke behavior. Stack order does not imply paint order. No comparison adds custom zero clipping. D3, Vega, and Bokeh use separate area and upper-edge line primitives, with paint order stated on their pages. AntV G2 strokes complete area outlines, including lower edges and end caps. ApexCharts and Nivo fill cumulative areas down to zero, so their translucent fills overlap and blend.

Dependencies

Serve the repository root over HTTP. The uPlot page uses the local dist/ build.

Most external pages download pinned library scripts from jsDelivr. billboard.js and dygraphs also load pinned stylesheets from jsDelivr. Recharts, MUI X Charts, Nivo, Victory, and React use pinned modules from esm.sh. Google Charts uses www.gstatic.com and requests frozen release 52 through its mutable loader.

Versions match the repository's benchmark pins where available. Nivo and Victory use separate exact release pins. The dataset stays local and requires no external data service.

External libraries retain their own licenses. ApexCharts terms restrict use in competing charting products. Highcharts requires an applicable license. amCharts retains its logo under its license terms. CanvasJS retains its credit link and has commercial and non-commercial license terms. Review these terms before publication or reuse.