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);
     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();