Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WTFd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
FOSS-AG
WTFd
Commits
d3aaecf3
Commit
d3aaecf3
authored
Oct 11, 2019
by
Philipp Hochkamp
Browse files
Options
Downloads
Plain Diff
Merge branch 'make-chart-tooltips-nicer' into 'master'
made chart tooltips nicer See merge request
!19
parents
7d7d3bca
f79e06ce
No related branches found
No related tags found
1 merge request
!19
made chart tooltips nicer
Pipeline
#1829
passed with warnings
Oct 11, 2019
Stage: test
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
html/static/leaderboard.js
+15
-1
15 additions, 1 deletion
html/static/leaderboard.js
internal/liveScoreboard.go
+8
-8
8 additions, 8 deletions
internal/liveScoreboard.go
with
23 additions
and
9 deletions
html/static/leaderboard.js
+
15
−
1
View file @
d3aaecf3
...
...
@@ -11,7 +11,8 @@ var chart;
type
:
"
time
"
,
time
:
{
unit
:
"
minute
"
,
max
:
Date
.
now
()
max
:
Date
.
now
(),
tooltipFormat
:
"
dd HH:mm:ss
"
}
}
],
...
...
@@ -32,6 +33,19 @@ var chart;
legend
:
{
display
:
false
},
tooltips
:
{
callbacks
:
{
label
:
function
(
tooltipItem
,
data
)
{
console
.
log
(
tooltipItem
.
datasetIndex
);
dataset
=
data
.
datasets
[
tooltipItem
.
datasetIndex
];
datapoint
=
dataset
.
data
[
tooltipItem
.
index
];
challName
=
datapoint
.
tooltipLabel
;
userName
=
dataset
.
label
;
points
=
datapoint
.
y
;
return
userName
+
'
:
'
+
challName
+
'
(
'
+
points
+
'
)
'
;
}
}
},
mantainAspectRatio
:
false
,
responsive
:
true
,
showScale
:
false
...
...
This diff is collapsed.
Click to expand it.
internal/liveScoreboard.go
+
8
−
8
View file @
d3aaecf3
...
...
@@ -91,7 +91,7 @@ func generateTableData() (tableData, error) {
func
updateScoreboard
()
error
{
type
chartDataPoint
struct
{
T
string
`json:"t"`
//
Label string
`json:"
l
abel"`
Label
string
`json:"
tooltipL
abel"`
Y
int
`json:"y"`
}
type
chartData
struct
{
...
...
@@ -120,7 +120,7 @@ func updateScoreboard() error {
return
err
}
sum
+=
chall
.
Points
data
[
i
+
1
]
=
chartDataPoint
{
T
:
s
.
Created
.
Format
(
time
.
RFC3339
),
Y
:
sum
}
//
, Label: s.ChallengeName}
data
[
i
+
1
]
=
chartDataPoint
{
T
:
s
.
Created
.
Format
(
time
.
RFC3339
),
Y
:
sum
,
Label
:
s
.
ChallengeName
}
}
a
:=
fmt
.
Sprintf
(
"#%X"
,
crc32
.
ChecksumIEEE
([]
byte
(
u
.
DisplayName
)))[
0
:
7
]
datas
=
append
(
datas
,
chartData
{
Pcolor
:
a
,
Color
:
a
,
Label
:
u
.
DisplayName
,
Data
:
data
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment