Browse Source

fix: ETA2.4.2 修改tooltip

ldong 2 months ago
parent
commit
b6ffe87453
1 changed files with 12 additions and 3 deletions
  1. 12 3
      src/hooks/chart/useChartRender.ts

+ 12 - 3
src/hooks/chart/useChartRender.ts

@@ -953,9 +953,18 @@ const setStackOrCombinChart = () => {
   //面积图百分比tooltip
   if(chartInfo.ChartType===3&&ExtraConfig?.HeapWay == 2) {
     options.tooltip = {
-        pointFormat: '<span>{series.name}</span>' +
-        ': <b>{point.percentage:.1f}%</b> ({point.y:,.1f})<br/>',
-        split: true
+      split: false,
+      shared: true,
+      dateTimeLabelFormats: {
+        // 时间格式化字符
+        day: '%Y/%m/%d',
+        week: "%Y/%m",
+        month: '%Y/%m',
+        year: '%Y/%m',
+      },
+      xDateFormat:'%Y/%m/%d',
+      className:'chart-tooltips-box',
+      pointFormat: '<span style=\"color:{point.color}\">●</span><span>{series.name}</span>' +':<b>{point.percentage:.1f}%</b> ({point.y:,.1f})<br/>'
     }
   }