js文件地址: https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>w3cschool (www.w3cschool.cn) </title>
<!-- 引入 echarts.js -->
<script src="echarts.min.js" rel="external nofollow" ></script>
</head>
<body>
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
<div id="main" style="width: 600px;height:400px;"></div>
<script type="text/javascript">
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
var option = {
title: {
text: 'ECharts 入门示例'
},
tooltip: {
data:['tooltip']
},
legend: {
data:['金额']
},
xAxis: {
data: ["壹钱包","银行","零钱","股票"]
},
yAxis: {
},
series: [{
name: '金额',
type: 'bar',
data: [23, 25, 4, 14]
}]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
</script>
</body>
</html>