document.onload = function() { var option = { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [{ data: [120, 200, 150, 80, 70, 110, 130], type: 'bar' }] }; var container = document.getElementById('app'); var chart = echarts.init(container); chart.setOption(option); }
#app { width: 200px; height: 200px; border: 1px solid red; }