官网示例:Examples - Apache ECharts
只需加上红色部分即可
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
label: {
show: true,
position: 'top'
},
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
}
]
};
效果图: