Echarts资源下载:
(转自:
版权声明:本文为CSDN博主「青春已被放纵了」的原创文章
原文链接:https://blog.csdn.net/qq_36373262/article/details/65635667)
可以在这里下载最新资源:https://github.com/ecomfe/echarts/archive/2.2.1.zip 下不了的话就去官网去下。
方法一:自己敲代码
折线图代码:
<script src="../build/source/echarts.js" type="text/javascript"></script> //echarts文件
<div style='background: #fff;width:900px;height:400px;margin:10px auto;'>
<div id="div1" style="width:900px;height:400px;border:1px solid #fff;margin:10px auto;background: #fff"></div>
</div> //折线图背景(如果两个折线图放一起的话,两个div名称要不一样 )
<script type="text/javascript">
require.config({
paths: {
echarts: '../build/dist' //引用资源文件夹路径,注意路径
}
});
require(
[
'echarts',
'echarts/chart/line' // 按需加载所需图表,用到什么类型就加载什么类型,这里不需要考虑路径