Commit 1d15f88a authored by 吴颖's avatar 吴颖

'修改图表'

parent 4c5206b3
......@@ -17,17 +17,10 @@ Page({
lesson_id: '',
child_id: '',
class_single_id: '',
ec: {
onInit: function (canvas, width, height) {
chartLine = echarts.init(canvas, null, {
width: width,
height: height
});
canvas.setChart(chartLine);
}
}
ec: null,
},
onLoad: function (options) {
this.init()
this.setData({
coach_id: app.globalData.coach_id,
class_id: options.class_id,
......@@ -38,6 +31,33 @@ Page({
this.getcomment()
this.getbadges()
},
init() {
const getPixelRatio = () => {
let pixelRatio = 0
wx.getSystemInfo({
success: function (res) {
pixelRatio = res.pixelRatio
},
fail: function () {
pixelRatio = 0
}
})
return pixelRatio
}
var dpr = getPixelRatio()
this.setData({
ec: {
onInit: function (canvas, width, height) {
chartLine = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr
});
canvas.setChart(chartLine);
}
}
})
},
getcomment: function () {
let params = {
url: 'coach/comment',
......@@ -46,6 +66,10 @@ Page({
class_id: this.data.class_id,
lesson_id: this.data.lesson_id,
child_id: this.data.child_id,
// coach_id: 5,
// class_id: 16,
// lesson_id: 69,
// child_id: 303,
},
callback: (data) => {
this.setData({
......@@ -79,6 +103,8 @@ Page({
show: false
},
radar: {
// radius: 100
center: ['52%', '50%'],
shape: 'circle',
splitNumber: 4, // 分割段数
indicator: xData, // 数据
......
<view class="top">
<view class="title">运动表现</view>
<view class="canvasbox">
<view class="canvasbox">
<view class="canvas_title">运动表现</view>
<view class="canvasbox1">
<ec-canvas id="mychart" class="canvas" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>
</view>
</view>
......
.container {
width: 100%;
height: 500rpx;
}
ec-canvas {
width: 100%;
height: 100%;
}
page {
background: #F7F8FA;
......@@ -19,15 +10,25 @@ page {
margin-bottom: 20rpx;
padding: 50rpx 30rpx;
}
.top .canvasbox {
.canvasbox {
width: 100%;
height: 605rpx;
height: 635rpx;
background: #FFFFFF;
border-radius: 15rpx;
position: relative;
margin-bottom: 20rpx;
}
.canvas_title {
padding-left: 30rpx;
padding-top: 50rpx;
font-size: 26rpx;
font-weight: bold;
color: #1A1A1A;
z-index: 100;
}
.top .canvasbox .canvas {
.canvasbox .canvasbox1 {
width: 100%;
height: 100%;
height: 555rpx;
}
.one {
padding: 49rpx 28rpx 32rpx 28rpx;
......
......@@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": false,
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
......@@ -21,14 +21,20 @@
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false
"userConfirmedUseCompilerModuleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.14.0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment