zhangli 1 жил өмнө
parent
commit
19dd1d08de

+ 16 - 0
src/views/modules/knowledge/statistics/components/commonEchart.vue

@@ -60,6 +60,22 @@ export default {
           that.$emit('legendselectchanged',params.selected)
         }
       });
+      let echartTime=null
+      echartInstance.on('highlight', (params) => {
+        echartTime = setInterval(() => {
+            echartInstance.dispatchAction({
+                  type: 'showTip',
+                  seriesIndex: 0,
+                  name: params.name,
+              });
+          }, 300)
+      })
+      echartInstance.on('downplay', () => {
+        echartInstance.dispatchAction({
+              type: 'hideTip'
+          })
+          clearInterval(echartTime);
+      })
       if(that.option.showheigh){
         let indexOfMax = 0;
         let max = that.option.series[0].data.reduce( (a,c,i) => c.value > a ? (indexOfMax = i,c.value) : a, 0)