1echarts官网Apache ECharts
2 echarts图表集里面有海量的示例
使用攻略:
柱状图
1
const option = {
title: {
text: this.title,
subtext: '单位:'+this.data_name,
textStyle: { fontSize: 12 },
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: this.legend,
left:'center'
},
grid: {
left:'5%',
right:'5%',
bottom:'2%',
top:'15%',
containLabel:true
},
toolbox: {
show : true,
},
xAxis: {
data: this.xAxisData,
interval:0,
},
yAxis: [
{
type : 'value',
boundaryGap: [0, 0.1]
}
],
series: [
{
name: '指标值',
type: 'bar',
data: this.yAxisName,
barWidth: 30, //修改柱子的宽度
},
]
};