From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 23 Feb 2021 11:59:50 +0000 (-0800) Subject: Perf docs: tension is now 0 by default (#8500) X-Git-Tag: v3.0.0-beta.12~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1471458c498857b32d887f26380d205e09bb31e;p=thirdparty%2FChart.js.git Perf docs: tension is now 0 by default (#8500) --- diff --git a/docs/docs/general/performance.md b/docs/docs/general/performance.md index ff67426c8..7f2ce1502 100644 --- a/docs/docs/general/performance.md +++ b/docs/docs/general/performance.md @@ -113,46 +113,13 @@ onmessage = function(event) { ## Line Charts -### Disable Bezier Curves +### Leave Bézier curves disabled -If you are drawing lines on your chart, disabling bezier curves will improve render times since drawing a straight line is more performant than a bezier curve. - -To disable bezier curves for an entire chart: - -```javascript -new Chart(ctx, { - type: 'line', - data: data, - options: { - elements: { - line: { - tension: 0 // disables bezier curves - } - } - } -}); -``` +If you are drawing lines on your chart, disabling Bézier curves will improve render times since drawing a straight line is more performant than a Bézier curve. Bézier curves are disabled by default. ### Automatic data decimation during draw -Line element will automatically decimate data, when the following conditions are met: `tension` is `0`, `stepped` is `false` (default) and `borderDash` is `[]` (default). This improves rendering speed by skipping drawing of invisible line segments. - -```javascript -new Chart(ctx, { - type: 'line', - data: data, - options: { - elements: { - line: { - tension: 0, // disables bezier curves - fill: false, - stepped: false, - borderDash: [] - } - } - } -}); -``` +Line element will automatically decimate data, when `tension`, `stepped`, and `borderDash` are left set to their default values (`false`, `0`, and `[]` respectively). This improves rendering speed by skipping drawing of invisible line segments. ### Enable spanGaps