From 973574fd62a1a130a1c229f812e70cfe3763b48e Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 14 十月 2026 09:54:10 +0800
Subject: [PATCH] feat(bi): 增加CRM数据展示功能并优化图表组件

---
 src/views/bi/dashboard/chart-options.ts |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/views/bi/dashboard/chart-options.ts b/src/views/bi/dashboard/chart-options.ts
index f01bc66..ca6c55f 100644
--- a/src/views/bi/dashboard/chart-options.ts
+++ b/src/views/bi/dashboard/chart-options.ts
@@ -40,13 +40,17 @@
   xData: string[],
   series: Array<{ name: string; data: number[] }>,
   colors: string[] = [C.cyan, C.blue, C.purple],
+  horizontal = false,
 ): EChartsOption {
   return {
-    grid: { bottom: 40, left: 48, right: 16, top: 16 },
+    grid: { bottom: 40, left: horizontal ? 140 : 48, right: 16, top: 16 },
     legend: { ...darkLegend, bottom: 0 },
     tooltip: { ...darkTooltip, axisPointer: { type: 'shadow' }, trigger: 'axis' },
-    xAxis: { ...darkAxis, data: xData, type: 'category' },
-    yAxis: { ...darkAxis, type: 'value' },
+    xAxis: horizontal ? { ...darkAxis, type: 'value' } : { ...darkAxis, data: xData, type: 'category' },
+    yAxis: horizontal ? {
+      ...darkAxis, data: xData, type: 'category', inverse: true,
+      axisLabel: { ...darkAxis.axisLabel, width: 125, overflow: 'truncate', interval: 0 },
+    } : { ...darkAxis, type: 'value' },
     series: series.map((s, i) => ({
       barGap: '30%',
       barMaxWidth: 36,

--
Gitblit v1.9.3