Unique style for all perfs in chart

Colors are kept, but the styles are a bit adjusted.

Advantages:
  * No more ambiguous lines in the rating chart (Bullet and Zh, Rapid and Ultra)
  * Fixes #4615
pull/4616/head
ProgramFOX 2018-09-11 12:39:30 +02:00
parent 539378eb35
commit c19b86f890
1 changed files with 18 additions and 19 deletions

View File

@ -17,23 +17,22 @@ lichess.ratingHistoryChart = function(data, singlePerfName) {
};
$('div.rating_history').each(function() {
var dashStyles = [
// standard gametypes
'Solid',
'Solid',
'Solid',
'Solid',
// exotic
'ShortDash',
'ShortDash',
'ShortDash',
// extreme
'ShortDot',
'ShortDot',
'ShortDot',
// training
'Dash',
// UltraBullet
'ShortDot'
// order of perfs from RatingChartApi.scala
'Solid', // Bullet
'Solid', // Blitz
'Solid', // Rapid
'Solid', // Classical
'ShortDash', // Correspondence
'ShortDash', // Chess960
'ShortDash', // KotH
'ShortDot', // 3+
'ShortDot', // Anti
'ShortDot', // Atomic
'Dash', // Horde
'ShortDot', // Racing Kings
'Dash', // Crazyhouse
'Dash', // Puzzle
'Dash' // Ultrabullet
].filter(indexFilter);
$(this).highcharts('StockChart', {
yAxis: {
@ -42,7 +41,7 @@ lichess.ratingHistoryChart = function(data, singlePerfName) {
credits: disabled,
legend: disabled,
colors: ["#56B4E9", "#0072B2", "#009E73", "#459F3B", "#F0E442", "#E69F00", "#D55E00",
"#CC79A7", "#DF5353", "#66558C", "#99E699", "#FFAEAA"
"#CC79A7", "#DF5353", "#66558C", "#99E699", "#FFAEAA", "#56B4E9", "#0072B2", "#009E73"
].filter(indexFilter),
rangeSelector: {
enabled: true,
@ -65,7 +64,7 @@ lichess.ratingHistoryChart = function(data, singlePerfName) {
return {
name: serie.name,
type: 'line',
dashStyle: dashStyles[i % dashStyles.length],
dashStyle: dashStyles[i],
marker: {
enabled: true,
radius: 2