events defined by `chart.on(eventName, ...` are not triggered
See original GitHub issuedefined events are not triggered
(at least) finished
and rendered
events are not triggered/executed.
Version & Environment
- ECharts version v4.2.0-rc2
- Browser version chrome-70.0.3538.77
- OS Version windows 7
Expected behaviour
the function defined should be triggered. in given example: having ‘finished loading’ in console
ECharts option
var myChart = echarts.init(document.getElementById('chart1'), null, {
"devicePixelRatio": null,
"renderer": "canvas",
"width": null,
"height": "600px"
});
myChart.setOption({
"title": {
"text": "test",
},
"grid": [
{
"top": "5%",
"height": "60%",
"width": "60%",
"left": "5%",
"containLabel": false,
"borderColor": "transparent",
"show": "1"
}
],
"xAxis": [
{
"type": "time",
"min": "dataMin",
"max": "dataMax"
}
],
"yAxis": [
{
"type": "value",
}
],
"series": {"name": "insufficient_data", "type": "bar"},
});
myChart.on('finished', function (params){
console.log('finished loading');
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
events defined by `chart.on(eventName, ...` are not triggered
found the issue. there is a problem with triggering the events when the dataset is empty. if there is no data to be...
Read more >[GitHub] arashdalir opened a new issue #9341: events defined by ...
arashdalir opened a new issue #9341: events defined by `chart.on(eventName, ...` are not triggered URL: ...
Read more >Handling Events | Charts
Overview. Google charts can fire events that you can listen for. Events can be triggered by user actions, such as when a user...
Read more >React google chart timeline handle event not working on ...
I have react google chart timeline with chartEvents. I want when clicked on define chart, display modal window. On first page load it...
Read more >ECharts Document
Attention: Event triggered by user switching legend in ECharts 2.x is changed from ... could assign by name attribute when not defined dataIndex?:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As intermediate solution, you could add an event listener to the parent div object in order to receive click-coordinates. They then can be transformed into real axis coordinates:
In the axis option, you might have to add triggerEvent property.
myChart.setOption({ . . "xAxis": [ { triggerEvent: true, } ], "yAxis": [ { triggerEvent: true, } ], })
This worked for me. Hope it helps.