Node / Charts · guide
Charts — overview
Current Apexify.js 6.0.0 documentation for Charts — overview.
ApexPainter charts route through ChartCreator (lib-next/chart/chart-creator.ts) and render PNG Buffer outputs via @napi-rs/canvas.
Entry points
| Method | Purpose |
|---|---|
await painter.createChart(type, data, options?, painterOpts?) | Single chart (pie, bar, horizontalBar, line, scatter, radar, polarArea). |
await painter.createComboChart(options, painterOpts?) | One Cartesian canvas: bars + lines with dual Y scales (ComboChartOptions). |
await painter.createComparisonChart(options, painterOpts?) | Two standalone charts in one image (side-by-side or stacked) (ComparisonChartOptions). |
Optional painterOpts follows other painters (resolveAssetRefs / prepareForRender when you embed $… asset refs).
Implementation layout
| Area | Location |
|---|---|
| Router | lib-next/chart/chart-creator.ts |
| Pie / donut | lib-next/chart/impl/piechart.ts (+ types/chart-pie) |
| Vertical bar | impl/barchart.ts |
| Horizontal bar | impl/horizontalbarchart.ts |
| Line | impl/linechart.ts (**shared AxisConfig, legend helpers) |
| Scatter | impl/scatterchart.ts |
| Radar | impl/radarchart.ts |
| Polar area | impl/polarareachart.ts |
| Combo | impl/combochart.ts |
| Comparison | impl/comparisonchart.ts |
| Backgrounds | helpers/chartBackground.ts (paintChartCanvasBackground) |
Scenes
SceneCreator layers type: 'chart', chartComparison, chartCombo call the same creators — options shapes match createChart / createComparisonChart / createComboChart.
Guide map
| # | Topic |
|---|---|
| — | Shared appearance & legend |
| 02 | Pie & donut |
| 03 | Vertical bar |
| 04 | Horizontal bar |
| 05 | Line |
| 06 | Scatter |
| 07 | Radar |
| 08 | Polar area |
| 09 | Combo (bars + lines) |
| 10 | Comparison (two panels) |
Minimal createChart calls
SOURCEtypescript
typescript
Donut is createChart('pie', slices, { type: 'donut', donutInnerRadius: … }) — see Pie.