第一步:先去githup上面下载
地址
可以把刚下载下来的代码在微信开发者工具中跑起来
具体就不说了
项目下载下来之后吧ec-canvas拷贝到自己的目录尽量与pages同级
在pages的index下的index.js
import * as echarts from '../../ec-canvas/echarts';
const app = getApp();
function initChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
//这里的option可以去echarts官网里面的option一起使用
var option