Closed sbowman closed 9 years ago
Whenever I try to call getBarsAtEvent, I get the error: "Uncaught TypeError: Cannot read property 'apply' of undefined".
I've got this JSX:
<ReactChart.Bar ref="placementsGraph" name="test" data={chartData} options={this.chartOptions} className="placements-chart" onClick={this.chartClicked}/>
In my chartClicked method, I call:
chartClicked: function(event) { console.log('Clicked!', this.refs.placementsGraph.getBarsAtEvent(event)); }
According to the error, this bit of code in core.js is failing:
function extra(type) { classData[type] = function() { this.state.chart[name].apply(this.state.chart, arguments); }; }
I put a few debug messages in there, and "name" is blank, so this.state.chart[name] is undefined. What exactly is this bit of code trying to do?
This will work, however:
this.refs.placementsGraph.state.chart.getBarsAtEvent(event)
@sbowman That seems the only way to get the function yes.
Whenever I try to call getBarsAtEvent, I get the error: "Uncaught TypeError: Cannot read property 'apply' of undefined".
I've got this JSX:
In my chartClicked method, I call:
According to the error, this bit of code in core.js is failing:
I put a few debug messages in there, and "name" is blank, so this.state.chart[name] is undefined. What exactly is this bit of code trying to do?