Skip to content
Apexify.jsDocs
Apexify.js version v5.4.5

Node / Charts · guide

Charts — overview

Current Apexify.js 6.0.0 documentation for Charts — overview.

apexify.jsRuntime: nodeCURRENTSince 6.0.0

ApexPainter charts route through ChartCreator (lib-next/chart/chart-creator.ts) and render PNG Buffer outputs via @napi-rs/canvas.


Entry points

MethodPurpose
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

AreaLocation
Routerlib-next/chart/chart-creator.ts
Pie / donutlib-next/chart/impl/piechart.ts (+ types/chart-pie)
Vertical barimpl/barchart.ts
Horizontal barimpl/horizontalbarchart.ts
Lineimpl/linechart.ts (**shared AxisConfig, legend helpers)
Scatterimpl/scatterchart.ts
Radarimpl/radarchart.ts
Polar areaimpl/polarareachart.ts
Comboimpl/combochart.ts
Comparisonimpl/comparisonchart.ts
Backgroundshelpers/chartBackground.ts (paintChartCanvasBackground)

Scenes

SceneCreator layers type: 'chart', chartComparison, chartCombo call the same creators — options shapes match createChart / createComparisonChart / createComboChart.


Guide map


Minimal createChart calls

SOURCEtypescript
typescript
Studio
const pie = await painter.createChart(  'pie',  [    { label: 'A', value: 60, color: '#6366f1' },    { label: 'B', value: 40, color: '#22c55e' },  ],  { dimensions: { width: 560, height: 420 }, labels: { title: { text: 'Mix' } } }); const bars = await painter.createChart(  'bar',  [    { label: 'Q1', value: 100, xStart: 0, xEnd: 1, color: '#3b82f6' },    { label: 'Q2', value: 140, xStart: 1, xEnd: 2, color: '#8b5cf6' },  ],  {    dimensions: { width: 720, height: 440 },    axes: { y: { label: 'Units', range: { min: 0, max: 160, step: 40 } } },    grid: { show: true },  });

Donut is createChart('pie', slices, { type: 'donut', donutInnerRadius: … }) — see Pie.


Next steps