Skip to content

Commit 4e18320

Browse files
author
Raj Jaiswal
committed
fix: check if datapoint exists
1 parent c6ee205 commit 4e18320

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)