xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

event is not work #371

Closed microwin168 closed 2 years ago

microwin168 commented 2 years ago

when I use the demo code ,the event is not work ,I don't know why this happen? <div echarts [options]="options" class="demo-chart" (chartinit)="onChartEvent($event, 'chartInit')" (chartclick)="onChartEvent($event, 'chartClick')" (chartdblclick)="onChartEvent($event, 'chartDblClick')" (chartmousedown)="onChartEvent($event, 'chartMouseDown')" (chartmouseup)="onChartEvent($event, 'chartMouseUp')" (chartmouseover)="onChartEvent($event, 'chartMouseOver')" (chartmouseout)="onChartEvent($event, 'chartMouseOut')" (chartglobalout)="onChartEvent($event, 'chartGlobalOut')" (chartcontextmenu)="onChartEvent($event, 'chartContextMenu')" (chartdatazoom)="onChartEvent($event, 'chartDataZoom')"> </div>

onChartEvent(event: any, type: string) { console.log('chart event:', type, event); }

xieziyu commented 2 years ago

There is a bug in the demo page. The event emitters are case sensitive. Please refer to the source file: https://github.com/xieziyu/ngx-echarts/blob/master/src/app/pages/demo-basic/basic/basic-events/basic-events.component.html

microwin168 commented 2 years ago

Thanks,It works