From 733ee07fa78569261f8ef86377db3cba49b53ab8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-FUDKNA8\\znjsz" Date: Mon, 22 Jan 2024 17:02:38 +0800 Subject: [PATCH] update chart month --- src/assets/svg/status_icon.svg | 11 +++++++ src/components/TeamChartMonth.vue | 27 +++++++++++------ src/components/TeamChartMonthOptions.js | 39 +++++++++++++++---------- src/pages/DataPage.vue | 2 +- 4 files changed, 53 insertions(+), 26 deletions(-) create mode 100644 src/assets/svg/status_icon.svg diff --git a/src/assets/svg/status_icon.svg b/src/assets/svg/status_icon.svg new file mode 100644 index 0000000..c5abfe2 --- /dev/null +++ b/src/assets/svg/status_icon.svg @@ -0,0 +1,11 @@ + + + 状态icon + + + + + + + + \ No newline at end of file diff --git a/src/components/TeamChartMonth.vue b/src/components/TeamChartMonth.vue index 8d24771..0fa4d39 100644 --- a/src/components/TeamChartMonth.vue +++ b/src/components/TeamChartMonth.vue @@ -1,5 +1,5 @@ @@ -55,8 +65,7 @@ onMounted(() => { height: 300px; } -.chart-inner { -} +.chart-inner {} .chart-chart { height: 100%; diff --git a/src/components/TeamChartMonthOptions.js b/src/components/TeamChartMonthOptions.js index db7fcd0..3aa26fc 100644 --- a/src/components/TeamChartMonthOptions.js +++ b/src/components/TeamChartMonthOptions.js @@ -1,43 +1,49 @@ export const options = { grid: { - top: "10%", - bottom: "10%", + top: 0, + left: 0, + right: 0, + bottom: 0 }, title: [ { text: "当前产量:" + 100 + " 片", left: "27%", textAlign: "center", - top: "67%", + top: "70%", textStyle: { - fontSize: 12, + fontSize: 16, + color: '#fffa' }, }, { text: "目标产量:" + 100 + " 片", left: "27%", textAlign: "center", - top: "82%", + top: "85%", textStyle: { - fontSize: 12, + fontSize: 16, + color: '#fffa' }, }, { text: "当前成品率:" + 22 + "%", - left: "73%", + left: "72%", textAlign: "center", - top: "67%", + top: "70%", textStyle: { - fontSize: 12, + fontSize: 16, + color: '#fffa' }, }, { text: "目标成品率:" + 22 + "%", - left: "73%", + left: "72%", textAlign: "center", - top: "82%", + top: "85%", textStyle: { - fontSize: 12, + fontSize: 16, + color: '#fffa' }, }, ], @@ -71,7 +77,7 @@ export const options = { }, detail: { valueAnimation: true, - fontSize: 12, + fontSize: 16, offsetCenter: [0, "0%"], formatter: "{value}%", color: "rgba(255, 255, 255, 1)", @@ -113,11 +119,11 @@ export const options = { detail: { show: true, valueAnimation: true, - fontSize: 12, + fontSize: 16, offsetCenter: [0, "0%"], - formatter: 0 + "%", + // formatter: 0 + "%", // formatter: (nowYield / targetYield * 100).toFixed(1) + '%', - color: "#fff8", + color: "#fff", }, data: [ { @@ -165,5 +171,6 @@ export default function setup(echartInstance, data) { new_options.series[0].data[0].value = (data.nowProduction / data.targetProduction * 100).toFixed(1) new_options.series[1].data[0].value = data.targetYield new_options.series[1].data[1].value = data.nowYield + new_options.series[1].detail.formatter = (data.nowYield / data.targetYield * 100).toFixed(2) + '%', echartInstance.setOption(new_options); } diff --git a/src/pages/DataPage.vue b/src/pages/DataPage.vue index ff64dff..0f3ea85 100644 --- a/src/pages/DataPage.vue +++ b/src/pages/DataPage.vue @@ -10,7 +10,7 @@ import TeamChartMonth from "../components/TeamChartMonth.vue";
- +