运行结果显示空的
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>bar</title>
<script src="js/echarts.js"></script>
</head>
<body>
<div id="main" style='width:900px; height:600px; background:#ccc;'></div>
<script>
var myChart=echarts.init(document.getElementById('main'));
var option={
title:{
text: "echarts入门实例"
},
toolbox:{
show: true,
feature: {
saveAsImage:{
show:true
}
}
},
legend:{
data:['销量']
},
xAxis:{
data:['衬衫','羊毛衫','雪纺衫','裤子','袜子']
},
yAxis:{},
//数据
series:[{
name:"销量",
type:"bar",
data:[5,20,36,10,10,20]
}]
};
//使用指定数据和配置项显示图表
myChart.setOption(Option);
</script>
</body>
</html>