<div id="bargainTrend" style="width: 100%;height:250px;"></div>
return {
month: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
lineData1: [150, 220, 430, 360, 450, 680, 100, 450, 680, 200, 680, 200],
lineData2: [200, 210, 230, 350, 450, 600, 360, 456, 258, 369, 411, 256],
barData1: [150, 220, 430, 360, 450, 680, 100, 450, 680, 200, 680, 200],
barData2: [200, 210, 230, 350, 450, 600, 360, 456, 258, 369, 411, 256],
}
methods() {
drawBargainOrderLine(xAxisData, lineData1, lineData2, barData1, barData2) {
let eChart = this.$echarts.init(document.getElementById("bargainTrend"));
this.eChart = eChart;
eChart.setOption({
title: {text: ""},
tooltip: {
formatter: '{a}: {c}'
},
grid: {
left: '3%',
right: '3%',
bottom: '3%',
containLabel: true
},
legend: {
show: true,
data: ['订单金额', '订单量', '订单金额折线', '订单量折线'],
right: "0%",
textStyle: {
color: "#000"
}
},
xAxis: [
{
type: "category",
axisTick: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: "#eeeeee",
},
},
axisLabel: {
inside: false,
textStyle: {
color: "#999",
fontWeight: "normal",
fontSize: "12",
},
},
splitLine: {show: false},
data: xAxisData,
},
{
type: "category",
axisLine: {show: false},
axisTick: {show: false},
axisLabel: {show: false},
splitArea: {show: false},
splitLine: {show: false},
},
],
yAxis: [
{
type: "value",
axisTick: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: "#eeeeee",
},
},
splitLine: {
show: false,
lineStyle: {
color: "#32346c ",
},
},
axisLabel: {
textStyle: {
color: "#bac0c0",
fontWeight: "normal",
fontSize: "12",
},
formatter: "{value}",
},
}
],
series: [
{
type: "bar",
name: '订单金额',
itemStyle: {
show: true,
color: "#301de0",
borderWidth: 0,
borderType: "solid",
emphasis: {
shadowBlur: 15,
shadowColor: "rgba(105,123, 214, 0.7)",
},
},
zlevel: 1,
barWidth: 20,
data: barData1,
},
{
type: "bar",
name: '订单量',
itemStyle: {
show: true,
color: "#a800ff",
borderWidth: 0,
borderType: "solid",
emphasis: {
shadowBlur: 15,
shadowColor: "rgba(105,123, 214, 0.7)",
},
},
zlevel: 2,
barWidth: 20,
data: barData2,
},
{
zlevel: 4,
type: "line",
name: '订单金额折线',
color: ["#301de0"],
symbolSize: 8,
symbol: "circle",
data: lineData1,
itemStyle: {
normal: {
lineStyle: {
color: "#8d83f7",
type: "solid"
}
}
},
tooltip: {
formatter: '{b}<br/>订单金额:{c}<br/>'
}
},
{
zlevel: 5,
type: "line",
name: '订单量折线',
color: ["#a800ff"],
symbolSize: 8,
symbol: "circle",
data: lineData2,
itemStyle: {
normal: {
lineStyle: {
color: "#8d83f7",
type: "solid"
}
}
},
tooltip: {
formatter: '{b}<br/>订单量:{c}<br/>'
}
}
],
});
},
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183