apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.21k stars 19.6k forks source link

echarts4.0.2里myChart.on()不能获取categories的返回 #7523

Closed tudou167 closed 4 years ago

tudou167 commented 6 years ago

One-line summary [问题简述]

echarts4.0.2里myChart.on()不能获取顶部分类的返回 线与节点皆没有问题 console.log(myChart) 里找不到顶部分类的对象

Version & Environment [版本及环境]

Expected behaviour [期望结果]

myChart.on() 能触发分类并返回参数 或者能获取对象绑定事件

ECharts option [ECharts配置项]

    categories: [{
        name: periods[0],
        itemStyle: {
            normal: {
                color: periodsColor[0],
            }
        }
    }, {
        name: periods[1],
        itemStyle: {
            normal: {
                color: periodsColor[1],
            }
        }
    }, {
        name: periods[2],
        itemStyle: {
            normal: {
                color: periodsColor[2],
            }
        }
    }, {
        name: '测试',
        itemStyle: {
            normal: {
                color: periodsColor[2],
            }
        }
    }],


### Other comments [其他信息]
<!-- For example: Screenshot or Online demo -->
<!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->

myChart.on('click', function (params) {
        //console.log(myChart);
        //console.log(params);

    });
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.