option = {
tooltip : {
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis : [
{
type : 'category',
data : ['交换机', '核心交换机', 'OLT设备', '传输设备', '汇聚交换'],
axisTick: {
alignWithLabel: true
},
axisLabel: {
show: true,
textStyle: {
color: 'black',
fontSize : 15,
fontWeight:20
}
}
}
],
yAxis : [
{ name: '单位(kw))',
type: 'value',
axisLabel: {
show: true,
interval: 'auto',
formatter: '{value}'
},
show: true
}
],
series : [
{
name:'直接访问',
type:'bar',
barWidth: '30%',
data:[40, 30, 38, 56, 38],
itemStyle: {
normal: {
color: '#597EF7',
label: {
show: false,
//开启显示
position: 'top',
formatter: '{c}',
//在上方显示
textStyle: { //数值样式
color: '#000000',
fontSize: 12
}
}
}
},
}
]
};
注意:本文归作者所有,未经作者允许,不得转载