]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Perf docs: tension is now 0 by default (#8500)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Tue, 23 Feb 2021 11:59:50 +0000 (03:59 -0800)
committerGitHub <noreply@github.com>
Tue, 23 Feb 2021 11:59:50 +0000 (13:59 +0200)
docs/docs/general/performance.md

index ff67426c8897cc8fdd0c868b1831ab39f8ed4df7..7f2ce15021c674158152e03ba2583a73d87fb80a 100644 (file)
@@ -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