javascript - Callbacks on echarts bar graph (e.g. onClick)
问题描述
I'm trying to use echarts in one of my project and haven't worked with echarts before. I've found quit good examples to start with but I want to achieve some additional functionality on bar charts like some callbacks on clicking on individual bars. I'm able to see formatter function for tool-tip here but couldn't find click event. Also, is there any event for clicking on labels on x-axis ? I've checked documentation for echarts here and found callback events but couldn't find a way to get them working for bar charts. Any help/suggestion or am I missing something here ?
解决方案
这有效:
var myChart = echarts.init(document.getElementById('main'));
myChart.on("click", function (event) {
console.log(event);
});
'click' 事件仅在单击栏时触发。
推荐阅读
- python - 一段时间后使用 nohup 执行 python 脚本时出错:selenium.common.exceptions.TimeoutException:消息:
- python - scipy.solve_ivp 的浮点精度
- python - 如果我使用单个字段,Django 不会提交我的表单
- python - Beautiful Soup,有条件地提取 Href
- snowflake-cloud-data-platform - 是否可以针对 blob 存储表创建外部阶段?
- sql - 为什么我在尝试加入表时收到 Oracle 错误 ORA-01790?
- hangouts-chat - 如何删除 Bot 消息格式的文本省略号(Google Chat API)
- java - 如何在 android 服务中的 onTaskRemoved 中设置 Firebase 侦听器
- java - 什么是 XML 配置继承到基于 Java 的配置的等价物?
- docker - 如何通过 nginx 反向代理将多个 Vue 前端项目捆绑到一个域中?