mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 22:44:24 +01:00
Sort scoregraph labels by score (#349)
* Added label sort by position in the plotly chart
This commit is contained in:
committed by
Kevin Chung
parent
cbdb80fa4a
commit
9838ef334e
@@ -50,6 +50,14 @@ function scoregraph () {
|
||||
traces.push(trace);
|
||||
}
|
||||
|
||||
traces.sort(function(a, b) {
|
||||
var scorediff = b['y'][b['y'].length - 1] - a['y'][a['y'].length - 1];
|
||||
if(!scorediff) {
|
||||
return a['x'][a['x'].length - 1] - b['x'][b['x'].length - 1];
|
||||
}
|
||||
return scorediff;
|
||||
});
|
||||
|
||||
var layout = {
|
||||
title: 'Top 10 Teams',
|
||||
paper_bgcolor: 'rgba(0,0,0,0)',
|
||||
|
||||
Reference in New Issue
Block a user