From 8f03176d42f60339d7ebc2528541eec49c0b0079 Mon Sep 17 00:00:00 2001 From: xianfuxing Date: Wed, 15 Aug 2018 20:50:35 +0800 Subject: [PATCH] # up increment, total chart --- .../dashboard/admin/components/LineChart.vue | 33 ++---------- .../dashboard/admin/components/PanelGroup.vue | 8 +-- src/views/dashboard/admin/index.vue | 52 +++++++------------ 3 files changed, 28 insertions(+), 65 deletions(-) diff --git a/src/views/dashboard/admin/components/LineChart.vue b/src/views/dashboard/admin/components/LineChart.vue index 547af13..c25cb7f 100644 --- a/src/views/dashboard/admin/components/LineChart.vue +++ b/src/views/dashboard/admin/components/LineChart.vue @@ -27,9 +27,6 @@ export default { }, chartData: { type: Object - }, - xAxis: { - type: Array } }, data() { @@ -75,11 +72,11 @@ export default { } }, methods: { - setOptions({ totalHistoryData, actualData } = {}) { + setOptions({ historyData, xAxis, title } = {}) { this.chart.setOption({ xAxis: { // data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], - data: this.xAxis, + data: xAxis, boundaryGap: false, axisLabel: { interval: 0 @@ -108,10 +105,10 @@ export default { } }, legend: { - data: ['Total', 'Increment'] + data: [title] }, series: [{ - name: 'Total', itemStyle: { + name: title, itemStyle: { normal: { color: '#FF005A', lineStyle: { @@ -122,29 +119,9 @@ export default { }, smooth: true, type: 'line', - data: totalHistoryData, + data: historyData, animationDuration: 2800, animationEasing: 'cubicInOut' - }, - { - name: 'Increment', - smooth: true, - type: 'line', - itemStyle: { - normal: { - color: '#3888fa', - lineStyle: { - color: '#3888fa', - width: 2 - }, - areaStyle: { - color: '#f3f8ff' - } - } - }, - data: actualData, - animationDuration: 2800, - animationEasing: 'quadraticOut' }] }) }, diff --git a/src/views/dashboard/admin/components/PanelGroup.vue b/src/views/dashboard/admin/components/PanelGroup.vue index 805dbc6..18f5db0 100644 --- a/src/views/dashboard/admin/components/PanelGroup.vue +++ b/src/views/dashboard/admin/components/PanelGroup.vue @@ -1,7 +1,7 @@