From: LeeLenaleee <39033624+LeeLenaleee@users.noreply.github.com> Date: Wed, 18 Nov 2020 12:55:41 +0000 (+0100) Subject: v2 note not nessecary in v3 docs and update example (#8071) X-Git-Tag: v3.0.0-beta.7~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=046d37882ab88845e3f7b9a091fe8c046577ac29;p=thirdparty%2FChart.js.git v2 note not nessecary in v3 docs and update example (#8071) * v2 note not nessecary in v3 docs * adjusted example Co-authored-by: Jacco van den Berg --- diff --git a/docs/docs/developers/api.md b/docs/docs/developers/api.md index 1846c3002..b2f04c4a8 100644 --- a/docs/docs/developers/api.md +++ b/docs/docs/developers/api.md @@ -28,14 +28,12 @@ myLineChart.data.datasets[0].data[2] = 50; // Would update the first dataset's v myLineChart.update(); // Calling update now animates the position of March from 90 to 50. ``` -> **Note:** replacing the data reference (e.g. `myLineChart.data = {datasets: [...]}` only works starting **version 2.6**. Prior that, replacing the entire data object could be achieved with the following workaround: `myLineChart.config.data = {datasets: [...]}`. - A `mode` string can be provided to indicate what should be updated and what animation configuration should be used. Core calls this method using any of `'active'`, `'hide'`, `'reset'`, `'resize'`, `'show'` or `undefined`. `'none'` is also a supported mode for skipping animations for single update. Please see [animations](../configuration/animations.mdx) docs for more details. Example: ```javascript -myChart.update(); +myChart.update('active'); ``` See [Updating Charts](updates.md) for more details. @@ -180,4 +178,4 @@ Finds the chart instance from the given key. If the key is a `string`, it is int ```javascript const chart = Chart.getChart("canvas-id") -``` \ No newline at end of file +```