Commit 6bdf66f
authored
Keep legend length in sync with data length
If you have a line chart that's data prop has a dataset value with a variable length of objects (eg a chart with a non-constant number of legend items), the original updateChart can only account for datasets that are growing in size, not shrinking. I added a quick check to the updateChart function that pops out the extraneous array values, if necessary. This saves you from having to call redraw over and over and can make your app run much smoother.1 parent c8e84aa commit 6bdf66f
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
| |||
0 commit comments