控制台有报错Uncaught SyntaxError: Unexpected token 'export'错误信息
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>bar</title>
<script src="/node_modules/echarts/echarts.all.js"></script>
</head>
<body>
<div id="main" style="width: 900px;height: 600px"></div>
<script type="text/javascript">
//var echarts = require('echarts');
//基于准备好的dom,初始化echarts实例
var myChart =echarts.init(document.getElementById('main'));
var option={
title:{
text:'Echarts 入门实例'
},
//工具箱
toolbox:{
show: true,
feature:{
saveAsImage:{
show:true
}
}
},
//图例
legend:{
data:['销售']
},
//x轴
xAxis:{
data:["衬衫","裤子","高跟鞋"]
}
yAxis:{},
//数据
series:[{
name:'销售',
type:'bar'
data:[5,20,36,10,10,20]
}]
};
//使用刚指定的配置和数据展示图表
myChart.setOption(option);
</script>
</body>
</html>