From f61b75b5fd6725b442cab3665359da5d761496c2 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 5 Sep 2025 15:06:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A2=B3=E6=8E=92=E6=94=BE-=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8C=85=E5=9B=B4=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IntegratedEnergy/CarbonEmission/config.ts | 8 ++++++ .../IntegratedEnergy/CarbonEmission/data.json | 3 +- .../IntegratedEnergy/CarbonEmission/index.vue | 28 +++++++++++++++++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/config.ts b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/config.ts index 026dbb4..0809b6b 100644 --- a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/config.ts +++ b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/config.ts @@ -6,10 +6,17 @@ import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index' import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' import { fontStyle } from 'html2canvas/dist/types/css/property-descriptors/font-style' +import {chartInitConfig} from "@/settings/designSetting"; export const includes = ['xAxis', 'yAxis'] +const otherOption = { + sceneCode: '', + titleText: '碳排放', + unit: dataJson.unit, +} const option = { + ...otherOption, grid: { left: '3%', right: '4%', @@ -149,4 +156,5 @@ export default class Config extends PublicConfigClass implements CreateComponent public chartConfig = cloneDeep(CarbonEmissionConfig) // 图表配置项 public option = echartOptionProfixHandle(option, includes) + public attr = { ...chartInitConfig, x: 0, y: 0, w: 450, h: 320, zIndex: 1 } } diff --git a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/data.json b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/data.json index 8977344..2533d57 100644 --- a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/data.json +++ b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/data.json @@ -61,5 +61,6 @@ "电": 130, "燃气": 160 } - ] + ], + "unit": "万kwh" } diff --git a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/index.vue b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/index.vue index ea67334..5d52fa2 100644 --- a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/index.vue +++ b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/index.vue @@ -1,9 +1,16 @@ + + From dfd524fa121dbc4af2054b22239777a32d41d989 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 5 Sep 2025 15:33:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A2=B3=E6=8E=92=E6=94=BE-=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IntegratedEnergy/CarbonEmission/config.ts | 50 +++++++++++++++---- .../IntegratedEnergy/CarbonEmission/data.json | 48 +++++++++--------- 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/config.ts b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/config.ts index 0809b6b..6e93879 100644 --- a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/config.ts +++ b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/config.ts @@ -66,22 +66,50 @@ const option = { } }, xAxis: { - show: true, - type: 'category' - }, - yAxis: { - show: true, - type: 'value', - name: '单位:万/kwh', - nameGap: 30, + type: 'category', axisLine: { + lineStyle: { + color: 'rgba(255, 255, 255, 0.1)', + } + }, + axisTick: { show: false }, - splitLine: { + // + axisLabel: { + color: '#eee', + interval: 0, + fontSize: 9, + margin: 20 + } + + }, + // name: '单位:万/kwh', + yAxis: { + type: 'value', + min: 0, + interval: 25, + name: '单位:万/kwh', + nameTextStyle:{ + color: 'rgba(255, 255, 255, 0.8)', + }, + axisLine: { show: true, lineStyle: { - type: 'dashed', - opacity: 0.5 + color: 'rgba(255, 255, 255, 0.1)', + } + }, + axisTick: { + show: false + }, + axisLabel: { + color: 'rgba(255, 255, 255, 0.8)', + formatter: '{value}' + }, + splitLine: { + lineStyle: { + color: 'rgba(255, 255, 255, 0.1)', + type: 'solid' } } }, diff --git a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/data.json b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/data.json index 2533d57..3db2006 100644 --- a/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/data.json +++ b/src/packages/components/Charts/IntegratedEnergy/CarbonEmission/data.json @@ -3,63 +3,63 @@ "source": [ { "月份": "1月", - "电": 120, - "燃气": 130 + "电": 20, + "燃气": 30 }, { "月份": "2月", - "电": 200, - "燃气": 130 + "电": 66, + "燃气": 30 }, { "月份": "3月", - "电": 150, - "燃气": 312 + "电": 50, + "燃气": 12 }, { "月份": "4月", - "电": 80, - "燃气": 268 + "电": 8, + "燃气": 68 }, { "月份": "5月", - "电": 70, - "燃气": 155 + "电": 7, + "燃气": 55 }, { "月份": "6月", - "电": 110, - "燃气": 117 + "电": 10, + "燃气": 17 }, { "月份": "7月", - "电": 130, - "燃气": 160 + "电": 30, + "燃气": 60 }, { "月份": "8月", - "电": 130, - "燃气": 160 + "电": 84, + "燃气": 60 }, { "月份": "9月", - "电": 130, - "燃气": 160 + "电": 30, + "燃气": 50 }, { "月份": "10月", - "电": 130, - "燃气": 160 + "电": 22, + "燃气": 16 }, { "月份": "11月", - "电": 130, - "燃气": 160 + "电": 45, + "燃气": 54 }, { "月份": "12月", - "电": 130, - "燃气": 160 + "电": 13, + "燃气": 16 } ], "unit": "万kwh"