Home > Mobile >  Reference ECharts don't show, but has built a project copy page can show in the past, this is f
Reference ECharts don't show, but has built a project copy page can show in the past, this is f

Time:10-07

The import * as echarts from '../../ec - canvas/echarts. Js';

Const app=getApp ();

The function initChart (canvas, width, height) {
Const chart=echarts. Init (canvas, null, {
Width: the width,
Height: height
});
Canvas. SetChart (chart);


Var option={
BackgroundColor: "# FFF",
Color: [" # 37 a2da ", "# 67 e0e3", "# 9 fe6b8"],

Tooltip: {
The trigger: 'axis'
},
Legend: {

Data: [' A ', 'B', 'C']
},
The grid: {
ContainLabel: true
},

XAxis: {
Type: 'category',
BoundaryGap: false,
Data: [' on Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday ' ']
},
YAxis: {
X: 'center',
Type: 'value'
},
Series: [{
Name: 'A commodity,
Type: 'the line',
Smooth: true,
Data: [18, 36, 65, 30, 78, 40, 33]
}, {
Name: 'B' goods,
Type: 'the line',
Smooth: true,
Data: [12, 50, 51, 35, 70, 30, 20]
}, {
Commodity name: 'C',
Type: 'the line',
Smooth: true,
Data: [10, 30, 31, 50, 40, 20, 10]
}]
};

Chart. SetOption (option);
Return chart;
}

Page ({
OnShareAppMessage: function (res) {
Return {
Title: 'ECharts can used in WeChat applet! '
Path: '/pages/index/index,
Success: the function () {},
Fail: the function () {}
}
},
Data: {
Ec: {
The onInit: initChart
}
},

OnReady () {
}
});

No such thing as an error

CodePudding user response:

Json
{
"UsingComponents" : {
"Ec - canvas" : "../../ec - canvas/ec - canvas
"}
}
WXML


CodePudding user response:

Is there anyone passing bosses can solve ohoo

CodePudding user response:

The problems lie in the app. WXSS

Modified to him, you would have been displayed, I met you and you the same question

* *//* * app. WXSS
The container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;

Display: flex;
The flex - direction: the column;
The align - items: center;
The justify - content: space - between;
box-sizing: border-box;
}

CodePudding user response:

refer to fifth floor I turn a blind eye to reply:
problem is in the app. WXSS

Modified to him, you would have been displayed, I met you and you the same question

* *//* * app. WXSS
The container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;

Display: flex;
The flex - direction: the column;
The align - items: center;
The justify - content: space - between;
box-sizing: border-box;
}
b: yes, you can
  • Related