xiaohaizhao 6 ماه پیش
والد
کامیت
ab5c357756
1فایلهای تغییر یافته به همراه23 افزوده شده و 4 حذف شده
  1. 23 4
      salesPanel/customerBlance/index.js

+ 23 - 4
salesPanel/customerBlance/index.js

@@ -112,9 +112,24 @@ Component({
                 color: colors,
                 tooltip: {
                     trigger: 'axis',
+                    confine: true, // Ensure tooltip stays within the chart area
+                    formatter: function (params) {
+                        let tooltipText = '';
+                        params.forEach((item, index) => {
+                            tooltipText += `${index==0?item.axisValue+'\n':''}${item.marker}${item.seriesName}: ${item.value}${item.seriesName == getMapText('同比增长率') ? '%' : ''}\n`;
+                        });
+                        return tooltipText;
+                    },
+                    textStyle: {
+                        fontSize: 10, // Reduced font size
+                        lineHeight: 14 // Adjusted line height for smaller tooltip height
+                    }
                 },
                 legend: {
                     data: [`${getMapText('去年同期金额')}(${getMapText('万元')})`, `${getMapText('本期金额')}(${getMapText('万元')})`, `${getMapText('同比增长率')}`],
+                    textStyle: {
+                        fontSize: 10 // Reduced font size for legend
+                    }
                 },
                 xAxis: [{
                     type: 'category',
@@ -124,7 +139,8 @@ Component({
                     data: data.tbzzl.map(v => v.date),
                     axisLabel: {
                         interval: 0,
-                        rotate: 45
+                        rotate: 45,
+                        fontSize: 10 // Reduced font size for x-axis labels
                     }
                 }],
                 yAxis: [{
@@ -137,7 +153,8 @@ Component({
                             show: true,
                         },
                         axisLabel: {
-                            formatter: '{value}'
+                            formatter: '{value}',
+                            fontSize: 10 // Reduced font size for y-axis labels
                         }
                     },
                     {
@@ -150,7 +167,8 @@ Component({
                         },
                         axisLabel: {
                             formatter: '{value}',
-                            rotate: 45
+                            rotate: 45,
+                            fontSize: 10 // Reduced font size for y-axis labels
                         }
                     },
                     {
@@ -166,7 +184,8 @@ Component({
                             }
                         },
                         axisLabel: {
-                            formatter: '{value}'
+                            formatter: '{value}',
+                            fontSize: 10 // Reduced font size for y-axis labels
                         }
                     },