echarjs 柱状图实现demo

htm

 

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)

你可能感兴趣的:(html,css,前端)