Skip to content

Commit f147145

Browse files
authored
Perf docs: tension is now 0 by default (#8500)
1 parent 36966a4 commit f147145

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

docs/docs/general/performance.md

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -113,46 +113,13 @@ onmessage = function(event) {
113113

114114
## Line Charts
115115

116-
### Disable Bezier Curves
116+
### Leave Bézier curves disabled
117117

118-
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.
119-
120-
To disable bezier curves for an entire chart:
121-
122-
```javascript
123-
new Chart(ctx, {
124-
type: 'line',
125-
data: data,
126-
options: {
127-
elements: {
128-
line: {
129-
tension: 0 // disables bezier curves
130-
}
131-
}
132-
}
133-
});
134-
```
118+
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.
135119

136120
### Automatic data decimation during draw
137121

138-
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.
139-
140-
```javascript
141-
new Chart(ctx, {
142-
type: 'line',
143-
data: data,
144-
options: {
145-
elements: {
146-
line: {
147-
tension: 0, // disables bezier curves
148-
fill: false,
149-
stepped: false,
150-
borderDash: []
151-
}
152-
}
153-
}
154-
});
155-
```
122+
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.
156123

157124
### Enable spanGaps
158125

0 commit comments

Comments
 (0)