Modifying Data

There are two ways to update data in a chart: either in adding and removing individual points, or updating the existing data with an entirely new set of data points.

Updating individual data points

let label = 'Wed';
let valueFromEachDataset = [30];
let index = 10; // default for adding/removing values: last index

chart.addDataPoint(label, valueFromEachDataset); // by default adds at end
chart.addDataPoint(label, valueFromEachDataset, index);
let index = 10;

Updating full data

Another way is to simply update the entire data, including annotations, by passing the entire new data object to update.