Fix positions of pb and average lines when disabling start graph at 0 (#4103) albertying

* Change accountHistory y-axis min of average and pb lines

* extract the floor operation into a variable

* remove whitespace

* setting to 0

---------

Co-authored-by: Evan <64989416+Ferotiq@users.noreply.github.com>
Co-authored-by: Evan <evanrayweigel@outlook.com>
Co-authored-by: Miodec <jack@monkeytype.com>
This commit is contained in:
Albert 2023-03-24 07:21:18 -04:00 committed by GitHub
parent 317f5b23ba
commit 98b777dfcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -798,9 +798,17 @@ function fillContent(): void {
Math.floor(maxWpmChartVal) + (10 - (Math.floor(maxWpmChartVal) % 10));
if (!Config.startGraphsAtZero) {
accountHistoryScaleOptions["wpm"].min = Math.floor(minWpmChartVal);
const minWpmChartValFloor = Math.floor(minWpmChartVal);
accountHistoryScaleOptions["wpm"].min = minWpmChartValFloor;
accountHistoryScaleOptions["pb"].min = minWpmChartValFloor;
accountHistoryScaleOptions["wpmAvgTen"].min = minWpmChartValFloor;
accountHistoryScaleOptions["wpmAvgHundred"].min = minWpmChartValFloor;
} else {
accountHistoryScaleOptions["wpm"].min = 0;
accountHistoryScaleOptions["pb"].min = 0;
accountHistoryScaleOptions["wpmAvgTen"].min = 0;
accountHistoryScaleOptions["wpmAvgHundred"].min = 0;
}
if (!chartData || chartData.length == 0) {