]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
v2 note not nessecary in v3 docs and update example (#8071)
authorLeeLenaleee <39033624+LeeLenaleee@users.noreply.github.com>
Wed, 18 Nov 2020 12:55:41 +0000 (13:55 +0100)
committerGitHub <noreply@github.com>
Wed, 18 Nov 2020 12:55:41 +0000 (07:55 -0500)
* v2 note not nessecary in v3 docs
* adjusted example

Co-authored-by: Jacco van den Berg <jacco@uniware.nl>
docs/docs/developers/api.md

index 1846c3002d99b0fa66aad51ceff909e403c4fbb3..b2f04c4a8035664101eae542d688698ed8bfeea8 100644 (file)
@@ -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
+```