From 6f94b7cab31f9635b3d8077f314ea1948bf794fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Wed, 13 Dec 2023 13:54:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/LineChart.vue | 12 ++++++++++- src/views/dashboard/LineChart1.vue | 32 +++++++++++++----------------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/views/dashboard/LineChart.vue b/src/views/dashboard/LineChart.vue index 1e23544..cde90c4 100644 --- a/src/views/dashboard/LineChart.vue +++ b/src/views/dashboard/LineChart.vue @@ -64,6 +64,16 @@ export default { }, setOptions({expectedData, actualData} = {}) { this.chart.setOption({ + title: { + text: '标题1 ', + textStyle: { + align: 'center', + color: '#000', + fontSize: 20, + }, + top: '0%', + left: '0%', + }, xAxis: { data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], // boundaryGap: false, @@ -123,7 +133,7 @@ export default { }, { name: 'actual', - smooth: true, + smooth: false, type: 'line', itemStyle: { normal: { diff --git a/src/views/dashboard/LineChart1.vue b/src/views/dashboard/LineChart1.vue index ddd1063..2ba69d7 100644 --- a/src/views/dashboard/LineChart1.vue +++ b/src/views/dashboard/LineChart1.vue @@ -63,6 +63,16 @@ export default { }, setOptions({ expectedData, actualData } = {}) { this.chart.setOption({ + title: { + text: '标题1 ', + textStyle: { + align: 'center', + color: '#000', + fontSize: 20, + }, + top: '0%', + left: '0%', + }, xAxis: { data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], boundaryGap: false, @@ -74,7 +84,7 @@ export default { left: 10, right: 10, bottom: 20, - top: 30, + top: 50, containLabel: true }, tooltip: { @@ -92,25 +102,11 @@ export default { legend: { data: ['expected', 'actual'] }, - series: [{ - name: 'expected', itemStyle: { - normal: { - color: '#FF005A', - lineStyle: { - color: '#FF005A', - width: 2 - } - } - }, - smooth: true, - type: 'line', - data: expectedData, - animationDuration: 2800, - animationEasing: 'cubicInOut' - }, + series: [ + { name: 'actual', - smooth: true, + smooth: false, type: 'line', itemStyle: { normal: {