diff --git a/src/views/index.vue b/src/views/index.vue index 016d26d..2451860 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -119,7 +119,11 @@ export default { res.data.forEach((e) => { timedata.push(e.clickDate); }); - var numberdata = []; + var totalPricedata = []; + res.data.forEach((e) => { + totalPricedata.push(e.totalPrice); + }); + var numberdata = []; res.data.forEach((e) => { numberdata.push(e.count); }); @@ -235,13 +239,53 @@ export default { }, }, }, + { + name: "订单金额", + type: "line", + smooth: true, + showSymbol: false, + symbol: "circle", + symbolSize: 6, + data: totalPricedata, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: "#d6e3fd", + }, + { + offset: 1, + color: "#d6e3fd", + }, + ], + false + ), + }, + }, + itemStyle: { + normal: { + color: "#6194f9", + }, + }, + lineStyle: { + normal: { + width: 3, + }, + }, + }, ], }; option && myChart.setOption(option); } else { } }); - getWeekGoodsTradeTrend().then((res) => { + getWeekGoodsTradeTrend ().then((res) => { if (res.code == 200) { var timedata = []; res.data.forEach((e) => { @@ -250,6 +294,10 @@ export default { var numberdata = []; res.data.forEach((e) => { numberdata.push(e.count); + }); + var totalPricedata = []; + res.data.forEach((e) => { + totalPricedata.push(e.totalPrice); }); var chartDom = document.getElementById("main"); var myChart = echarts.init(chartDom); @@ -363,6 +411,46 @@ export default { }, }, }, + { + name: "订单金额", + type: "line", + smooth: true, + showSymbol: false, + symbol: "circle", + symbolSize: 6, + data: totalPricedata, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: "rgba(216, 244, 247,1)", + }, + { + offset: 1, + color: "rgba(216, 244, 247,1)", + }, + ], + false + ), + }, + }, + itemStyle: { + normal: { + color: "#58c8da", + }, + }, + lineStyle: { + normal: { + width: 3, + }, + }, + }, ], }; option && myChart.setOption(option);