<script src="echarts.js"></script>
<div id="main" style="width: 600px;height:400px;"></div>
var myChart = echarts.init(document.getElementById('main'));
var option = {
title: {
text: 'ECharts 入门示例-尝试'
},
tooltip: {},
legend: {
data:['数量',"销量"]
},
xAxis: {
data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子","二狗"]
},
yAxis: {},
series: [{
name: '数量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20,30]
},{
name: '销量',
type: 'bar',
data: [22, 80, 16, 60, 10, 20,39]
}]
};
myChart.setOption(option);
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |