Skip to content

Commit 0c811e3

Browse files
committed
fix: prevent error on double tap on empty chart
1 parent b720030 commit 0c811e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/charting/listener/BarLineChartTouchListener.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ export class BarLineChartTouchListener extends ChartTouchListener<BarLineChartBa
563563
const h = chart.getHighlightByTouchPoint(event.data.extraData.x, event.data.extraData.y);
564564
chart.notify({ eventName: 'doubleTap', data: event.data, object: chart, highlight: h });
565565
}
566-
if (chart.isDoubleTapToZoomEnabled() && chart.getData().getEntryCount() > 0) {
566+
if (chart.isDoubleTapToZoomEnabled() && chart.getData()?.getEntryCount() > 0) {
567567
const trans = this.getTrans(event.data.extraData.x, event.data.extraData.y);
568568

569569
chart.zoom(chart.isScaleXEnabled() ? 1.4 : 1, chart.isScaleYEnabled() ? 1.4 : 1, trans.x, trans.y);

0 commit comments

Comments
 (0)