echarts 设置折线颜色 标题线颜色 折线点颜色等
option = {
tooltip: {
trigger: 'axis'
},
color:["red","green","blue","black"],//对应线的颜色 以及以下图标的颜色
legend: {
icon: 'circle',//circle 是圆形 rect 是矩形 标题的图标设置
itemWidth: 20,
itemHeight: 10,
itemGap: 10,
data: ['工地', '平均值','北京','东城'],
"textStyle": { //标题的文字样式
"fontSize": 16,
//"color": "red",
"text-align": "left",
//"margin-left": "-100px"
}
},
toolbox: {
show: true,
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar'] },
restore: { show: true },
saveAsImage: { show: true }
}
},
calculable: true,
xAxis: [
{
type: 'category',
boundaryGap: false,
data: hourlist
}
],
yAxis: [
{
type: 'value',
axisLabel: {
formatter: '{value}'
}
}
],
grid: {
//show: true,
//borderColor: '#2C2D49',//区域边框颜色
x: 40,//距离左边 单位为px
x2: 30,//距离右边 单位为px
y: 40,//上下距离 单位为px
//height: 100//区域高度 单位为px 最好不设 会自动适配
},
series: [
{
name: '工地',
type: 'line',
data: yinshulist,
itemStyle: {
normal: {
lineStyle: {
color: 'red',
width: 2
}
}
}
},
{
name: '平均值',
type: 'line',
data: yinshulist1,
itemStyle: {
normal: {
lineStyle: {
color: 'green',
width: 2
}
}
}
}
,
{
name: '北京',
type: 'line',
data: yinshulist2,
itemStyle: {
normal: {
lineStyle: {
color: 'blue',//折线条的颜色
width: 2,
lineStyle:{
color:'#03242d'//折线点的颜色
}
}
}
}
},
{
name: '东城',
type: 'line',
data: yinshulist3,
itemStyle: {
normal: {
lineStyle: {
color: 'black',
width: 2
}
}
}
}
]
};
本文为若言博客网(http://www.blog520.com)原创作品,版权所有,欢迎转载,转载请注明原文出处,不注明作者和原文出处若言博客网有权追究其法律责任。原文链接:http://www.blog520.com/Article/10232.html