From: Jukka Kurkela Date: Sat, 23 Nov 2019 22:39:12 +0000 (+0200) Subject: Add min/max to performance documentation (#6785) X-Git-Tag: v3.0.0-alpha~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5393003acb19164d6112e5c4745c37e6a9ee7be;p=thirdparty%2FChart.js.git Add min/max to performance documentation (#6785) * Add min/max to performance documentation * Review1 * Review2 --- diff --git a/docs/general/performance.md b/docs/general/performance.md index a1b344a87..9aba3175f 100644 --- a/docs/general/performance.md +++ b/docs/general/performance.md @@ -34,6 +34,31 @@ new Chart(ctx, { }); ``` +## Specify `min` and `max` for scales + +If you specify the `min` and `max`, the scale does not have to compute the range from the data. + +```javascript +new Chart(ctx, { + type: 'line', + data: data, + options: { + scales: { + x: { + type: 'time', + min: new Date('2019-01-01').valueOf(), + max: new Date('2019-12-31').valueOf() + }, + y: { + type: 'linear', + min: 0, + max: 100 + } + } + } +}); +``` + ## Data Decimation Decimating your data will achieve the best results. When there is a lot of data to display on the graph, it doesn't make sense to show tens of thousands of data points on a graph that is only a few hundred pixels wide.