Commit 28d9ed5f by chenshu

feat:数据面板完成

parent 66140de6
......@@ -56,8 +56,8 @@ class Home extends React.Component {
if (res.success) {
const dataList = res.result.map(item => ({
time: moment(item.dateline).format('MM-DD'),
commentCount: item.studyNum,
commentRate: item.studyTime,
studyNum: item.studyNum,
studyTime: Math.round(item.studyTime / 6) / 10,
}))
this.createChart(dataList);
}
......@@ -104,11 +104,11 @@ class Home extends React.Component {
}
this._chart.clear();
this._chart.source(data, {
commentRate: {
studyTime: {
formatter: (val) => {
return val
},
// tickCount: 5,
tickCount: 5,
},
time: {
formatter: (val) => {
......@@ -119,11 +119,11 @@ class Home extends React.Component {
},
range: [0.06, 0.94]
},
commentCount: {
studyNum: {
formatter: (val) => {
return val
},
// tickCount: 5
tickCount: 5
}
});
this._chart.axis('time', {
......@@ -149,7 +149,7 @@ class Home extends React.Component {
}
}
})
this._chart.axis('commentRate', {
this._chart.axis('studyTime', {
label: {
textStyle: {
fill: '#666666',
......@@ -157,16 +157,16 @@ class Home extends React.Component {
}
}
})
this._chart.line().position('time*commentCount').color('#5289FA').tooltip('time*commentCount', function( time, commentCount){
this._chart.line().position('time*studyNum').color('#5289FA').tooltip('time*studyNum', function( time, studyNum){
return {
name: '学习人数',
value: commentCount
value: studyNum
}
});
this._chart.line().position('time*commentRate').color('#FFB714').tooltip('time*commentRate', function( time, commentRate){
this._chart.line().position('time*studyTime').color('#FFB714').tooltip('time*studyTime', function( time, studyTime){
return {
name: '人均学习时长',
value: commentRate
value: studyTime
}
});
......
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