Echarts入门示例

一个简单的Echarts入门示例,需要下载请移步至   http://echarts.baidu.com/index.html

来自官网的例子:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Echarts入门示例</title>
</head>
<body>
<div id="main" style="width:600px;height: 400px;"></div>
<script src="echarts.js"></script>
<script>
var myChart = echarts.init(document.querySelector("#main"));
var option = {
title:{
text: '入门示例'
},
tooltip:{},
legend:{
data:['销量']
},
xAxis:{
data:["衬衫","羊毛衫","裤子","袜子","高跟鞋"]
},
yAxis:{},
series:[{
name:'销量',
type:'bar',
data:[10,20,30,22,16]
}]
};
myChart.setOption(option);
</script>
</body>
</html>

 

posted @ 2017-07-02 00:07  Tsingtree  阅读(338)  评论(0编辑  收藏  举报