Skip to content

Commit 80bd3bc

Browse files
ryugarajRaj Jaiswal
andauthored
fix: chart sometimes crash on zoom re-render (#84)
* fix: chart sometimes crash on zoom re-render * fix: check if datapoint exists --------- Co-authored-by: Raj Jaiswal <[email protected]>
1 parent 8aa51c1 commit 80bd3bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/chart-api/chart-extra-context.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ function computeDerivedState(chart: Highcharts.Chart): ChartExtraContext.Derived
102102
for (const d of s.data) {
103103
// Points with y=null represent the absence of value, there is no need to include them and those
104104
// should have no impact on computed rects or navigation.
105-
if (d.visible && d.y !== null) {
105+
106+
// Although "d" can't be undefined according to Highcharts API, it does become undefined for chart containing more datapoints
107+
// than the cropThreshold for that series (specific cases of re-rendering the chart with updated options listening to setExteme updates)
108+
if (d && d.visible && d.y !== null) {
106109
seriesX.add(d.x);
107110
allXSet.add(d.x);
108111
addPoint(d);

0 commit comments

Comments
 (0)