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

'修改图表'

parent 4c5206b3
...@@ -17,17 +17,10 @@ Page({ ...@@ -17,17 +17,10 @@ Page({
lesson_id: '', lesson_id: '',
child_id: '', child_id: '',
class_single_id: '', class_single_id: '',
ec: { ec: null,
onInit: function (canvas, width, height) {
chartLine = echarts.init(canvas, null, {
width: width,
height: height
});
canvas.setChart(chartLine);
}
}
}, },
onLoad: function (options) { onLoad: function (options) {
this.init()
this.setData({ this.setData({
coach_id: app.globalData.coach_id, coach_id: app.globalData.coach_id,
class_id: options.class_id, class_id: options.class_id,
...@@ -38,6 +31,33 @@ Page({ ...@@ -38,6 +31,33 @@ Page({
this.getcomment() this.getcomment()
this.getbadges() 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 () { getcomment: function () {
let params = { let params = {
url: 'coach/comment', url: 'coach/comment',
...@@ -46,6 +66,10 @@ Page({ ...@@ -46,6 +66,10 @@ Page({
class_id: this.data.class_id, class_id: this.data.class_id,
lesson_id: this.data.lesson_id, lesson_id: this.data.lesson_id,
child_id: this.data.child_id, child_id: this.data.child_id,
// coach_id: 5,
// class_id: 16,
// lesson_id: 69,
// child_id: 303,
}, },
callback: (data) => { callback: (data) => {
this.setData({ this.setData({
...@@ -79,6 +103,8 @@ Page({ ...@@ -79,6 +103,8 @@ Page({
show: false show: false
}, },
radar: { radar: {
// radius: 100
center: ['52%', '50%'],
shape: 'circle', shape: 'circle',
splitNumber: 4, // 分割段数 splitNumber: 4, // 分割段数
indicator: xData, // 数据 indicator: xData, // 数据
......
<view class="top"> <view class="canvasbox">
<view class="title">运动表现</view> <view class="canvas_title">运动表现</view>
<view class="canvasbox"> <view class="canvasbox1">
<ec-canvas id="mychart" class="canvas" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas> <ec-canvas id="mychart" class="canvas" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>
</view> </view>
</view> </view>
......
.container {
width: 100%;
height: 500rpx;
}
ec-canvas {
width: 100%;
height: 100%;
}
page { page {
background: #F7F8FA; background: #F7F8FA;
...@@ -19,15 +10,25 @@ page { ...@@ -19,15 +10,25 @@ page {
margin-bottom: 20rpx; margin-bottom: 20rpx;
padding: 50rpx 30rpx; padding: 50rpx 30rpx;
} }
.top .canvasbox { .canvasbox {
width: 100%; width: 100%;
height: 605rpx; height: 635rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 15rpx; 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%; width: 100%;
height: 100%; height: 555rpx;
} }
.one { .one {
padding: 49rpx 28rpx 32rpx 28rpx; padding: 49rpx 28rpx 32rpx 28rpx;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"urlCheck": false, "urlCheck": true,
"es6": true, "es6": true,
"enhance": false, "enhance": false,
"postcss": true, "postcss": true,
...@@ -21,14 +21,20 @@ ...@@ -21,14 +21,20 @@
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"enableEngineNative": false,
"useIsolateContext": true, "useIsolateContext": true,
"useCompilerModule": false, "useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false "userConfirmedUseCompilerModuleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.14.0", "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