diff --git a/src/views/energyManagement/components/ElecConsumption.vue b/src/views/energyManagement/components/ElecConsumption.vue index b7abd52..ff91348 100644 --- a/src/views/energyManagement/components/ElecConsumption.vue +++ b/src/views/energyManagement/components/ElecConsumption.vue @@ -39,7 +39,7 @@ const chartOption = { borderWidth: 0, }, lineStyle: { - color: "target", + color: 'gradient', opacity: 0.7, curveness: 0.5, }, @@ -64,15 +64,21 @@ const loadData = async () => { ]; // 構造 links 連結 - const links = rawData.map((item) => ({ + const links = rawData.map((item, index) => ({ source: "Total", target: item.key, value: item.value, percentage: item.percentage, })); + const colors = ["#45f4ef", "#f5d54e", "#63ed84", "#5a5cac", "#ff5e5e", "#e266fe"]; // 更新 chartOption - chartOption.series[0].data = data; + chartOption.series[0].data = data.map((item, index) => ({ + ...item, + itemStyle: { + color: colors[index % colors.length], // 節點顏色 + }, + })); chartOption.series[0].links = links; // 初始化圖表 diff --git a/src/views/history/components/HistorySearch.vue b/src/views/history/components/HistorySearch.vue index 03ebd3c..031880e 100644 --- a/src/views/history/components/HistorySearch.vue +++ b/src/views/history/components/HistorySearch.vue @@ -160,7 +160,7 @@ onBeforeMount(() => {
-

+

{{ $t("history.system_category") }} :

{ />
-

+

{{ $t("history.device_category") }} :

{ />
-

{{ $t("history.point") }} :

+

+ {{ $t("history.point") }} : +