Improved highlighted data calculation so that it works with values different than 1

This commit is contained in:
Alejandro Celaya 2020-04-05 11:57:39 +02:00
parent f5cc1abe75
commit 66bf26f1dc

View file

@ -50,7 +50,7 @@ const renderGraph = (title, isBarChart, stats, max, highlightedStats) => {
const labels = keys(stats).map(dropLabelIfHidden); const labels = keys(stats).map(dropLabelIfHidden);
const data = values(!highlightedStats ? stats : keys(highlightedStats).reduce((acc, highlightedKey) => { const data = values(!highlightedStats ? stats : keys(highlightedStats).reduce((acc, highlightedKey) => {
if (acc[highlightedKey]) { if (acc[highlightedKey]) {
acc[highlightedKey] -= 1; acc[highlightedKey] -= highlightedStats[highlightedKey];
} }
return acc; return acc;