一、Echarts(小程序版)
1.1:下载 GitHub 上的 项目
1.2:但项目下载之后,打开小程序开发工具,可以看到效果如下,适配性还是比较完美的。
1.3.如果是在项目里面引入组件的话,打开从github上面下载的代码,将ec-canvas文件夹复制黏贴到你的项目里面。
好的,组件已经复制到了我的项目里面,现在我想实现一个折线图,现在开始去组件里面搬运复制黏贴代码了。
wxml(通过组件的方式使用)
js(引入插件的js,并进行初始化)
import * as echarts from '../../ec-canvas/echarts';
const app = getApp();
function initChart(canvas, width, height) {
const chart = echarts.init(canvas, null, {
width: width,
height: height
});
canvas.setChart(chart);
var option = {
title: {