<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
<div id="main" style="height:400px"></div>
<!-- <div id="main" :style="{width: ‘500px‘, height: ‘500px‘}"></div> -->
<script src="http://echarts.baidu.com/build/dist/echarts-all.js"></script>
<!-- <script src="customed.js"></script> -->
<script>
// 基于准备好的dom,初始化echarts图表
var dom=document.getElementById(‘main‘);
var myChart = echarts.init(dom,‘customed‘);
var option = {
tooltip: {
show: true
},
legend: {
data:[‘销量‘]
},
xAxis : [
{
type : ‘category‘,
data : ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
}
],
yAxis : [
{
type : ‘value‘
}
],
series : [
{
"name":"销量",
"type":"bar",
"data":[5, 20, 40, 10, 10, 20]
}
]
};
// 为echarts对象加载数据
myChart.setOption(option);
</script>
</body>
</html>