From 992d9322f0ea047af08e8abc5c28b2275d2ac19f Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Tue, 13 Jun 2023 18:24:13 +0200 Subject: [PATCH] Clarify update docs (#11345) --- docs/developers/updates.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developers/updates.md b/docs/developers/updates.md index f74730c8e..ed22e3315 100644 --- a/docs/developers/updates.md +++ b/docs/developers/updates.md @@ -4,13 +4,13 @@ It's pretty common to want to update charts after they've been created. When the ## Adding or Removing Data -Adding and removing data is supported by changing the data array. To add data, just add data into the data array as seen in this example. +Adding and removing data is supported by changing the data array. To add data, just add data into the data array as seen in this example, to remove it you can pop it again. ```javascript -function addData(chart, label, data) { +function addData(chart, label, newData) { chart.data.labels.push(label); chart.data.datasets.forEach((dataset) => { - dataset.data.push(data); + dataset.data.push(newData); }); chart.update(); } -- 2.47.3