浏览代码

Update echart.js

thetableman 1 年之前
父节点
当前提交
62b1d40069
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      nicegui/elements/echart.js

+ 14 - 0
nicegui/elements/echart.js

@@ -7,6 +7,20 @@ export default {
     convertDynamicProperties(this.options, true);
     convertDynamicProperties(this.options, true);
     this.chart.setOption(this.options);
     this.chart.setOption(this.options);
     this.chart.resize();
     this.chart.resize();
+    function unpack(e) {
+      return {
+        component_type: e.componentType,
+        series_type: e.seriesType,
+        series_index: e.seriesIndex,
+        series_name: e.seriesName,
+        name: e.name,
+        data_index: e.dataIndex,
+        data: e.data,
+        data_type: e.dataType,
+        value: e.value
+      };
+    }
+    this.chart.on('click', e => this.$emit("pointClick", unpack(e)));
   },
   },
   beforeDestroy() {
   beforeDestroy() {
     this.destroyChart();
     this.destroyChart();