chart

Docs › More

Moving from Apex●●●rts or Chart.●s

When Apex●●●rts changed its license or Chart.●s needs one plugin too many.

Apex●●●rts is no longer MIT from 5.0 (paid above $2M annual revenue) and adds a watermark without a key from 6.5. Chart.●s is free, but zoom, annotations and time axes need separate plugins and adapters. 82chart has all of them built in, under MIT.

Apex●●●rts

const chart = new Apex●●●rts(document.querySelector('#chart'), {
  chart: { type: 'line', height: 350, zoom: { enabled: true } },
  series: [{ name: 'Visitors', data: [120, 180, 150, 220] }],
  xaxis: { categories: ['Mon', 'Tue', 'Wed', 'Thu'] },
  yaxis: { labels: { formatter: (v) => v.toLocaleString() } },
});
chart.render();
const chart = createChart('#chart', {
  type: 'line',
  height: 350,
  zoom: true,
  numberFormat: 'comma',
  data: {
    labels: ['Mon', 'Tue', 'Wed', 'Thu'],
    series: [{ name: 'Visitors', data: [120, 180, 150, 220] }],
  },
});
Apex●●●rts82chart
chart.typetype
xaxis.categoriesdata.labels
series: [{ name, data }]data.series: [{ name, data }]
chart.stacked, stackType: '100%'stacked: true, 'percent'
plotOptions.bar.horizontalhorizontal: true
chart.zoom.enabledzoom: true
annotations.yaxis / xaxisannotations.y / x / bands
yaxis.labels.formatteryAxis.format or numberFormat
chart.toolbar.exportexporting
chart.updateSeries()chart.update(data)

Chart.●s

// before
new Chart(document.getElementById('c'), {
  type: 'bar',
  data: { labels: ['Jan', 'Feb', 'Mar'], datasets: [{ label: 'Sales', data: [12, 19, 14] }] },
});

// after (a div instead of a canvas)
createChart('#c', {
  type: 'bar',
  data: { labels: ['Jan', 'Feb', 'Mar'], series: [{ name: 'Sales', data: [12, 19, 14] }] },
});
Chart.●s82chart
<canvas>Any <div> (drawn as SVG)
datasets[].labelseries[].name
type: 'doughnut'type: 'donut'
type: 'bubble'type: 'scatter' with r on points
options.indexAxis: 'y'horizontal: true
scales.x.stacked / scales.y.stackedstacked: true
Zoom pluginzoom: true
Annotation pluginannotations
Date adapter (date-fns, moment …)Not needed; see time axes
chart.data = …; chart.update()chart.update(data)