miniprogram/pages/analyse/index.js
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
// pages/analyse/index.js
var util = require('../../utils/util.js')
// 1、引入依赖脚本
import * as echarts from '../../ec-canvas/echarts';
let chart = null;
// 2、进行初始化数据
function initChart(canvas, width, height, dpr) {
chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // 像素
});
canvas.setChart(chart);
var option = {
color: ['yellow', 'orange', 'red', 'green', '#0197ff', 'yellowgreen'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
data: ['米饭', '馒头', '汉餐', '全素', '特色', '回餐']
},
grid: {
left: 20,
right: 20,
bottom: 25,
top: 40,
containLabel: true
},
xAxis: [
{
type: 'value',
axisLine: {
lineStyle: {
color: '#999'
}
},
axisLabel: {
color: '#666'
}
}
],
yAxis: [
{
type: 'category',
axisTick: { show: true },
data: getApp().globalData.analysefoods,
axisLine: {
lineStyle: {
color: '#999'
}
},
axisLabel: {
color: '#666'
}
}
],
series: [
后面还有 340 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。