1
0
thetableman 1 жил өмнө
parent
commit
62b1d40069

+ 14 - 0
nicegui/elements/echart.js

@@ -7,6 +7,20 @@ export default {
     convertDynamicProperties(this.options, true);
     this.chart.setOption(this.options);
     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() {
     this.destroyChart();