echarts设置网格线颜色
xAxis: {
type: 'value',
splitLine: {
show: true,
lineStyle:{
color: ['#315070'],
width: 1,
type: 'solid'
}
}}
去掉ECHarts折线图中图例的圆点
在图例的配置项里,设置itemStyle的opacity为0即可。
legend
??|__data
????|__itemStyle
??????|__opacity:0
注意,itemStyle是图例图形的配置项。lineStyle是图例的线条配置项。
设置legend的图例形状
legend: {
data: [{
name: '计划负荷',
icon: 'rect',
},
{
name: '实时负荷',
icon: 'rect',
}
],
itemWidth: 25,
itemHeight: 6,
}
echarts折线图线条颜色和区域颜色设置
series: [
{
name:'近七日收益',
type:'line',
areaStyle: {
normal: {
color: '#091e3b'
}
},
itemStyle: {
normal: {
color: '#8cd5c2',
lineStyle: {
color: '#8cd5c2'
}
}
},
stack: '总量',
data:["91","29","93","64","105"]
}
]
设置柱形图多种颜色
series: [{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
itemStyle: {
normal: {
color: function(params) {
var colorList = ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622'];
return colorList[params.dataIndex]
}
}
}
}]
if (params.dataIndex >= colorList.length) {
index = params.dataIndex - colorList.length;
}
|