One last try to fix stepped charts...

This commit is contained in:
Mario Zechner 2023-07-18 21:11:59 +02:00
parent dbdf6e2f38
commit 0a97e4d15f
1 changed files with 4 additions and 1 deletions

View File

@ -179,7 +179,10 @@ class ItemsChart extends View {
}),
};
if (settings.chartType == "stepped") {
dataset.stepped = prices.length >= 2 && prices[0].price != prices[1].price ? "after" : "before";
dataset.stepped =
prices.length >= 2 && prices[0].price != prices[1].price && prices[prices.length - 2].price != prices[prices.length - 1].price
? "after"
: "before";
}
return dataset;