echarts修改X轴Y轴和折线的颜色-示例代码
<div id="cate" ref="cate"></div>
setCate() {
this.cate = this.$echarts.init(this.$refs.cate);
var option = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c}"
},
xAxis: {
type: "category",
axisLabel:{
show:true,
textStyle:{
color:"#fff"
}
},
data: ["06:00", "08:00", "10:00", "12:00", "14:00", "16:00", "18:00"]
},
yAxis: {
type: "value",
axisLabel:{//修改坐标系字体颜色
show:true,
textStyle:{
color:"#fff"
}
},
},
series: [
{
name: "金额/元",
data: [820, 932, 901, 434, 4290, 1330, 200],
type: "line",
itemStyle: {
normal: {
color: "#FFAA00", //改变折线点的颜色
lineStyle: {
color: "#fff" //改变折线颜色
}
}
}
}
]
};
this.cate.setOption(option);
}
}
本文来自博客园,作者:JackieDYH,转载请注明原文链接:https://www.cnblogs.com/JackieDYH/p/17634516.html

浙公网安备 33010602011771号