htm
<div id="main" style="width: 600px;height:400px;"></div>
js
let myCharts = echarts.init(document.getElementById('charts'))
let option = {
xAxis: {
type: 'category',
data: ['小明', '小红', '小王']
},
yAxis: {
type: 'value'
},
series: [
{
name: '语文',
type: 'bar',
data: [70, 92, 87],
}
]
}
myChart.setOption(option)