From 724fb0e97e2218c589f7be3a4a147b4daef71ffd Mon Sep 17 00:00:00 2001 From: Smith Date: Thu, 7 Apr 2022 00:30:19 +0200 Subject: [PATCH] switch graph to line chart --- dist/game-server.js | 13 ++++++++----- src/game-server.ts | 15 +++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dist/game-server.js b/dist/game-server.js index c4c7757..7b439b0 100644 --- a/dist/game-server.js +++ b/dist/game-server.js @@ -238,11 +238,14 @@ class ServerHistory { } const values = avg.concat(max); return [ - 'https://image-charts.com/chart?cht=bvg', + 'https://image-charts.com/chart?cht=lc', 'chs=600x300', - 'chma=' + e('0,0,10,0'), 'chf=' + e('bg,s,202225'), - 'chg=' + e('0,1,5,5,303030'), + 'chma=' + e('0,0,10,0'), + 'chls=' + e('2|2'), + // 'chm='+e('B,011040,0,0,0'), // line fill + 'chg=' + e('1,1,2,2,303030'), + // 'chm='+e('d,ffffff,0,-1,3|d,ffffff,1,-1,3'), // value markers 'chdl=' + e('AVG|MAX'), 'chdlp=t', 'chdls=' + e('ffffff,10'), @@ -251,10 +254,10 @@ class ServerHistory { 'chds=a', 'chd=' + e('t:' + avg.join(',') + '|' + max.join(',')), 'chl=' + e(values.join('|')), - 'chlps=' + e('color,ffffff|anchor,end|font.size,10|align,top'), + 'chlps=' + e('color,ffffff|anchor,end|font.size,12|align,top'), 'chxl=' + e('0:|' + xlabels.join('|')), 'chxr=' + e('1,0,' + playersMax), - 'chco=' + e('1234ef,fd7501') // bar colors + 'chco=' + e('1234ef,fd7501') // data colors ].join('&'); } } diff --git a/src/game-server.ts b/src/game-server.ts index 91af4e3..3e5deff 100644 --- a/src/game-server.ts +++ b/src/game-server.ts @@ -312,11 +312,14 @@ class ServerHistory { const values: string[] = avg.concat(max); return [ - 'https://image-charts.com/chart?cht=bvg', - 'chs=600x300', - 'chma='+e('0,0,10,0'), // margins + 'https://image-charts.com/chart?cht=lc', + 'chs=600x300', // image size 'chf='+e('bg,s,202225'), // background - 'chg='+e('0,1,5,5,303030'), // grid lines + 'chma='+e('0,0,10,0'), // margins + 'chls='+e('2|2'), // line styles + // 'chm='+e('B,011040,0,0,0'), // line fill + 'chg='+e('1,1,2,2,303030'), // grid lines + // 'chm='+e('d,ffffff,0,-1,3|d,ffffff,1,-1,3'), // value markers 'chdl='+e('AVG|MAX'), // labels 'chdlp=t', // label position 'chdls='+e('ffffff,10'), // label style @@ -325,10 +328,10 @@ class ServerHistory { 'chds=a', // scaling 'chd='+e('t:'+avg.join(',')+'|'+max.join(',')), // data 'chl='+e(values.join('|')), // data labels - 'chlps='+e('color,ffffff|anchor,end|font.size,10|align,top'), // data labels position & style + 'chlps='+e('color,ffffff|anchor,end|font.size,12|align,top'), // data labels position & style 'chxl='+e('0:|'+xlabels.join('|')), // x axis labels 'chxr='+e('1,0,'+playersMax), // axis range - 'chco='+e('1234ef,fd7501') // bar colors + 'chco='+e('1234ef,fd7501') // data colors ].join('&'); } }