Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
28d9ed5f
Commit
28d9ed5f
authored
Feb 28, 2021
by
chenshu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:数据面板完成
parent
66140de6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
src/modules/home/Home.jsx
+11
-11
No files found.
src/modules/home/Home.jsx
View file @
28d9ed5f
...
...
@@ -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
,
{
commentRat
e
:
{
studyTim
e
:
{
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
(
'
commentRat
e'
,
{
this
.
_chart
.
axis
(
'
studyTim
e'
,
{
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
,
commentRat
e
){
this
.
_chart
.
line
().
position
(
'time*
studyTime'
).
color
(
'#FFB714'
).
tooltip
(
'time*studyTime'
,
function
(
time
,
studyTim
e
){
return
{
name
:
'人均学习时长'
,
value
:
commentRat
e
value
:
studyTim
e
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment