From de08d568e56c4d768d612ed148a1d4044b7c3bf6 Mon Sep 17 00:00:00 2001 From: Ragu Ramaswamy Date: Thu, 13 Aug 2015 06:53:11 -0500 Subject: [PATCH] fix for https://github.com/rrag/react-stockcharts/issues/6 use the first chart as main chart if no EventCapture is defined --- src/lib/utils/ChartDataUtil.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/utils/ChartDataUtil.js b/src/lib/utils/ChartDataUtil.js index 1e5a34733..b388c873a 100644 --- a/src/lib/utils/ChartDataUtil.js +++ b/src/lib/utils/ChartDataUtil.js @@ -52,6 +52,7 @@ var ChartDataUtil = { var eventCapture = this.getChildren(children, /EventCapture$/); if (eventCapture.length > 1) throw new Error("only one EventCapture allowed"); if (eventCapture.length > 0) return eventCapture[0].props.mainChart; + if (eventCapture.length === 0) return this.getChildren(children, /Chart$/)[0].props.id; }, getClosestItem(plotData, mouseXY, chartData) { // console.log(chartData);