Charts

Rowsncolumns Spreadsheet renders charts via ECharts (or Plotly via opt-in), parses + emits OOXML chart XML, and accepts a custom renderer if neither default fits.

Spreadsheet ships a rich chart pipeline with full XLSX + ODS round-trip on every supported chart type. The render backend is ECharts by default; Plotly is available as an opt-in (@rowsncolumns/charts/plotly/basic-chart).

Supported chart types

All round-trip via XLSX import + export unless noted.

Type
Notes

Column (clustered / stacked)

Bar (clustered / stacked)

Line (smooth / stepped)

Area

Pie / doughnut

Scatter

Bubble

Size dimension on top of scatter

Radar

Treemap

Sunburst

Stock (line-derived)

OHLC / candlestick variants deferred

Waterfall

Emitted as c15:waterfallChart in mc:Choice + c:barChart fallback — Excel 2016+ renders natively, older Excel falls back to bars

Funnel

Same c15:funnelChart / fallback shape

Histogram

Auto/Sturges binning + bin-count override

Box & whisker

quartileMethod, showMean, showOutlier

Combo (mixed series)

Per-series seriesChartType picker

Dual-axis

secondaryValueAxisOptions round-trips

Not yet supported: 3D variants (bar3D / column3D / pie3D / line3D / area3D), surface, OHLC / candlestick stock. These need echarts-gl and are deferred.

Chart features

Every chart supports:

  • Titles, legends, axis labels — formula-driven titles & labels (range references resolved at render)

  • Data labels — value / category / percent

  • Trendlines — linear, polynomial, exponential, log

  • Error bars — value / percentage / stdev / custom

  • Data label styles — number formats applied per series

  • Series colors — per series + theme accents

  • Series gradient fills — linear (with degree) and path (with left/right/top/bottom insets). Mirrors OOXML <a:gradFill> inside <c:spPr>. Set series[].gradient on the chart spec.

  • Negative-value coloringinvertIfNegative + negativeColor on bar/column series

  • Chart move + resize with anchor cell + pixel offsets

  • Chart editing UIChartEditorDialog + ChartEditor components

Installation

ECharts is a peer dependency for the default backend:

For Plotly:

Basic usage

Wire charts through the useCharts hook (@rowsncolumns/charts) and pass the resulting handlers to CanvasGrid:

Series gradient fills

Set gradient on any series — overrides color:

For radial fills use type: "path" with left / right / top / bottom insets (0..1 each):

ODS export emits the equivalent <draw:gradient> definition; XLSX export emits <a:gradFill> inside <c:spPr>.

Bringing your own renderer

The default ECharts component is bundled, but charts are agnostic of the rendering layer. Pass your own component via the chart prop pipeline — the spec data flow is independent.

For an alternative renderer, import a different chart component (e.g. import "@rowsncolumns/charts/plotly/basic-chart") — the spec format is identical.

Last updated