Y轴显示的数据数值差太大
配置项如下
var arraydata = [{
"InfoName": "普通硅酸盐水泥",
"NetWeight": 2869.24
}, {
"InfoName": "普通硅酸盐水泥",
"NetWeight": 1020.7
}, {
"InfoName": "硅酸盐水泥",
"NetWeight": 220.34
}, {
"InfoName": "带肋钢筋(螺纹钢)",
"NetWeight": 56.92
}, {
"InfoName": "带肋钢筋(螺纹钢)",
"NetWeight": 56.42
}, {
"InfoName": "复合硅酸盐水泥",
"NetWeight": 50.44
}, {
"InfoName": "带肋钢筋(螺纹钢)",
"NetWeight": 20.72
}, {
"InfoName": "带肋钢筋(螺纹钢)",
"NetWeight": 10.14
}, {
"InfoName": "带肋钢筋(螺纹钢)",
"NetWeight": 15.9
}, {
"InfoName": "带肋钢筋(螺纹钢)",
"NetWeight": 10
}];
option = {
title: {
text: 'ECharts 入门示例1'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['进料量']
},
grid: {
left: '3%',
right: '4%',
bottom: '10%',
containLabel: true
},
xAxis: {
data: [{
value: arraydata[0].InfoName,
textStyle: {
fontSize: 8
}
}, {
value: arraydata[1].InfoName,
textStyle: {
fontSize: 8
}
}, {
value: arraydata[2].InfoName,
textStyle: {
fontSize: 8
}
}, {
value: arraydata[3].InfoName,
textStyle: {
fontSize: 8
}
}, {
value: arraydata[4].InfoName,
textStyle: {
fontSize: 8
}
}, {
value: arraydata[5].InfoName,
textStyle: {
fontSize: 8
}
}, {
value: arraydata[6].InfoName,
textStyle: {
fontSize: 8
}
}, {
value: arraydata[7].InfoName,
textStyle: {
fontSize: 8
}
}, {
value: arraydata[8].InfoName,
textStyle: {
fontSize: 8
}
}, {
value: arraydata[9].InfoName,
textStyle: {
fontSize: 8
}
}],
'axisLabel': {
formatter: function(value, index) {
return value.substr(0, 2) + "...";
},
//'interval': 0, rotate: 15
}
},
yAxis: {},
series: [{
name: '进料量',
type: 'bar',
barWidth: '70%',
data: [arraydata[0].NetWeight, arraydata[1].NetWeight, arraydata[2].NetWeight, arraydata[3].NetWeight, arraydata[4].NetWeight,
arraydata[5].NetWeight, arraydata[6].NetWeight, arraydata[7].NetWeight, arraydata[8].NetWeight, arraydata[9].NetWeight
]
}]
};