var xdata = ['2020-1-2', '2020-1-2', '2020-1-2', '2020-1-2', '2020-1-2', '2020-1-2', '2020-1-2']
var data = [70, 60, 80, 70, 60, 80, 50]
option = {
tooltip: {
trigger: "axis",
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
// borderRadius: 5,
// borderColor: "#6baab2",
// borderWidth: 1,
formatter: function (params) { // params[0].data.nameCode
let dot =
'<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:#02C4DD"></span>';
return (
params[0].name +
"<br>" +
"杆塔数量 :" +
params[0].value
);
}
},
grid: {
left: "4%",
right: "4%",
bottom: "3%",
top: "15%",
containLabel: true
},
xAxis: {
data: xdata,
triggerEvent: true,
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: true,
rotate: 0,
interval: 0,
textStyle: {
padding: [14, 0, 0, 0],
fontSize: 12,
color: "rgba(255,255,255,1)"
}
}
},
yAxis: {
// name: "单位:个数",
triggerEvent: true,
nameTextStyle: {
color: "rgba(255,255,255,1)",
fontSize: 12,
padding: [0, 0, 10, -20]
},
splitLine: {
show: true,
lineStyle: {
color: 'rgba(255,255,255,.1)'
}
},
axisTick: {
show: false
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(255,255,255,.1)'
}
},
axisLabel: {
show: true,
textStyle: {
color: "rgb(148,159,167)",
fontSize: 12
}
}
},
// color: ["#e54035"],
series: [{
name: "数量",
barMinHeight: 10,
type: "pictorialBar",
barCategoryGap: "60%",
// symbol: 'path://M0,10 L10,10 L5,0 L0,10 z',
symbol: "path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z",
//隔行变色
itemStyle: {
color: function (params) {
if (params.dataIndex % 2 === 0) {
return (new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 1,
color: "rgba(63,253,255,.1)"
},
{
offset: 0,
color: "rgba(63,253,255,1)"
}
]))
}
return (new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 1,
color: "rgba(6,120,255,.1)"
},
{
offset: 0,
color: "rgba(6,120,255,1)"
}
]))
}
},
data: data,
z: 10
},
]
}
09-22
08-06
2907
05-06
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交