Ver código fonte

v1.1.0 coding...

刘洋 1 ano atrás
pai
commit
91215ea7a7
1 arquivos alterados com 55 adições e 1 exclusões
  1. 55 1
      src/modules/analysis/marker-statistics/index.vue

+ 55 - 1
src/modules/analysis/marker-statistics/index.vue

@@ -440,9 +440,10 @@ const markerSubjectiveChartsOption = computed<EChartsOption>(() => {
     },
     tooltip: {
       trigger: 'axis',
+      triggerOn: 'click',
       // appendToBody:true,
       // confine: true,
-      // enterable: true,
+      enterable: true,
       // extraCssText: 'max-width:70%;max-height:96%;overflow:auto',
       axisPointer: {
         type: 'line',
@@ -453,6 +454,7 @@ const markerSubjectiveChartsOption = computed<EChartsOption>(() => {
           type: 'dashed',
         },
       },
+      // formatter: '{a0} {b0}: {c0}<br />{b1}: {c1}',
       // formatter: function (params) {
       //   let res = '';
       //   for (let i = 0; i < params.length; i++) {
@@ -469,6 +471,41 @@ const markerSubjectiveChartsOption = computed<EChartsOption>(() => {
       //   }
       //   return data + res;
       // }
+      formatter: function (params: any) {
+        console.log('ppp', params)
+        let html = `
+        <div style="margin: 0px 0 0;line-height:1;">
+            <div style="margin: 0px 0 0;line-height:1;">
+              <div style="font-size:14px;color:#666;font-weight:400;line-height:1;">${params[0].axisValue}</div>
+              <div style="margin: 10px 0 0;line-height:1;">
+        `
+        for (let i = 0; i < params.length; i++) {
+          let item = params[i]
+          html += `
+
+                <div style="margin: 0px 0 0;line-height:1;">
+                  <div style="margin: 0px 0 0;line-height:1;">
+                    ${item.marker}
+                    <span style="font-size:14px;color:#666;font-weight:400;margin-left:2px">${item.seriesName}</span>
+                    <span style="float:right;margin-left:20px;font-size:14px;color:#666;font-weight:900">${item.data}</span>
+                    <div style="clear:both"></div>
+                  </div>
+                  <div style="clear:both"></div>
+                </div>
+
+
+          `
+        }
+        html += `
+        <div style="clear:both"></div>
+              </div>
+              <div style="clear:both"></div>
+            </div>
+            <div style="clear:both"></div>
+          </div>
+        `
+        return html
+      },
     },
     xAxis: {
       axisLine: { show: false },
@@ -534,6 +571,23 @@ const markerObjectiveChartsOption = computed<EChartsOption>(() => {
       itemWidth: 14,
       data: ['评卷员客观分布', '小组客观分布', '题组客观分布'],
     },
+    tooltip: {
+      trigger: 'axis',
+      triggerOn: 'click',
+      // appendToBody:true,
+      // confine: true,
+      enterable: true,
+      // extraCssText: 'max-width:70%;max-height:96%;overflow:auto',
+      axisPointer: {
+        type: 'line',
+        crossStyle: {
+          color: '#999',
+        },
+        lineStyle: {
+          type: 'dashed',
+        },
+      },
+    },
     xAxis: {
       axisLine: { show: false },
       axisTick: { show: false },