Skip to content

Commit 6a2ed8a

Browse files
committed
Update: fastPath for fill
1 parent 2a9c325 commit 6a2ed8a

File tree

5 files changed

+399
-312
lines changed

5 files changed

+399
-312
lines changed

docs/general/performance.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ new Chart(ctx, {
8989

9090
### Automatic data decimation during draw
9191

92-
Line element will automatically decimate data, when the following conditions are met: `tension` is `0`, `steppedLine` is `false` (default), `fill` is `false` and `borderDash` is `[]` (default).`
92+
Line element will automatically decimate data, when the following conditions are met: `tension` is `0`, `steppedLine` is `false` (default) and `borderDash` is `[]` (default).`
9393
This improves rendering speed by skipping drawing of invisible line segments.
9494

9595
```javascript
@@ -109,6 +109,26 @@ new Chart(ctx, {
109109
});
110110
```
111111

112+
### Enable spanGaps
113+
114+
If you have a lot of data points, it can be more performant to enable spanGaps. This disables segmentation of line, which can be an unneeded step.
115+
116+
To enable spanGaps:
117+
118+
```javascript
119+
new Chart(ctx, {
120+
type: 'line',
121+
data: {
122+
datasets: [{
123+
spanGaps: true // enable for a single dataset
124+
}]
125+
},
126+
options: {
127+
spanGaps: true // enable for all datasets
128+
}
129+
});
130+
```
131+
112132
### Disable Line Drawing
113133

114134
If you have a lot of data points, it can be more performant to disable rendering of the line for a dataset and only draw points. Doing this means that there is less to draw on the canvas which will improve render performance.

0 commit comments

Comments
 (0)