From bc2c1f17b89a14fc26a44a3b2d5e874ba7dc356a Mon Sep 17 00:00:00 2001 From: "Mr.Dr.Professor Patrick" Date: Tue, 28 Nov 2023 12:28:04 +0100 Subject: [PATCH] fix(Highcharts plugin): fix console error on first render with split-pane (#355) --- .../renderer/components/withSplitPane/withSplitPane.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.tsx b/src/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.tsx index e8af40e1..685a0364 100644 --- a/src/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.tsx +++ b/src/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.tsx @@ -63,7 +63,7 @@ function forceHoverState( if (chartType === 'pie') { chart.tooltip.refresh(activePoints); chart.pointsForInitialRefresh = activePoints; - } else if (chart.series.length === 1) { + } else if (chart.series?.length === 1) { const series = chart.series[0]; const seriesType = (series && series.type) || (chart.options.chart && chart.options.chart.type); @@ -80,8 +80,8 @@ function forceHoverState( if (chartTypesWithoutCrosshair.indexOf(chartType) === -1) { const point = Array.isArray(activePoints) ? activePoints[0] : activePoints; - chart.xAxis[0].drawCrosshair(undefined, point); - chart.yAxis[0].drawCrosshair(undefined, point); + chart.xAxis?.[0].drawCrosshair(undefined, point); + chart.yAxis?.[0].drawCrosshair(undefined, point); } }