|
@ -18,20 +18,24 @@ let data3 = [200, 530, 920, 400, 600, 700, 300, 800]; |
|
|
let options = { |
|
|
let options = { |
|
|
tooltip: { |
|
|
tooltip: { |
|
|
show: true, |
|
|
show: true, |
|
|
trigger: "axis", |
|
|
// trigger: "axis",
|
|
|
axisPointer: { |
|
|
axisPointer: { |
|
|
// 坐标轴指示器,坐标轴触发有效
|
|
|
// 坐标轴指示器,坐标轴触发有效
|
|
|
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
|
|
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
|
|
}, |
|
|
}, |
|
|
valueFormatter: function (value) { |
|
|
formatter: function (params) { |
|
|
return value + " 起"; |
|
|
if (params.seriesName == "路段里程数") { |
|
|
|
|
|
return `<div>${params.marker} ${params.name} <span style="font-weight: bold;">${params.value} 公里</span></div>`; |
|
|
|
|
|
} else { |
|
|
|
|
|
return `<div>${params.marker} ${params.name} <span style="font-weight: bold;">${params.value} 起</span></div>`; |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
grid: { |
|
|
grid: { |
|
|
left: "0", |
|
|
left: "0", |
|
|
right: "0", |
|
|
right: "0", |
|
|
top: "90px", |
|
|
top: "90px", |
|
|
bottom: "20px", |
|
|
bottom: "-10px", |
|
|
containLabel: true, |
|
|
containLabel: true, |
|
|
}, |
|
|
}, |
|
|
xAxis: { |
|
|
xAxis: { |
|
@ -52,11 +56,14 @@ let options = { |
|
|
interval: 1, |
|
|
interval: 1, |
|
|
align: "center", |
|
|
align: "center", |
|
|
rotate: "1", |
|
|
rotate: "1", |
|
|
margin: "20", |
|
|
margin: 30, |
|
|
textStyle: { |
|
|
textStyle: { |
|
|
fontSize: 10, |
|
|
fontSize: 10, |
|
|
color: "#E5E7E8", |
|
|
color: "#E5E7E8", |
|
|
}, |
|
|
}, |
|
|
|
|
|
formatter: (value) => { |
|
|
|
|
|
return value.split("-").join("\n\n"); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
yAxis: [ |
|
|
yAxis: [ |
|
@ -262,7 +269,6 @@ let options = { |
|
|
opacity: 1, |
|
|
opacity: 1, |
|
|
color: function (params) { |
|
|
color: function (params) { |
|
|
var a = params.name; |
|
|
var a = params.name; |
|
|
// console.log("==========a=============", a);
|
|
|
|
|
|
return new echarts.graphic.LinearGradient( |
|
|
return new echarts.graphic.LinearGradient( |
|
|
0, |
|
|
0, |
|
|
0, |
|
|
0, |
|
@ -322,7 +328,6 @@ let options = { |
|
|
opacity: 1, |
|
|
opacity: 1, |
|
|
color: function (params) { |
|
|
color: function (params) { |
|
|
var a = params.name; |
|
|
var a = params.name; |
|
|
// console.log("==========a=============", a);
|
|
|
|
|
|
return new echarts.graphic.LinearGradient( |
|
|
return new echarts.graphic.LinearGradient( |
|
|
0, |
|
|
0, |
|
|
0, |
|
|
0, |
|
|