(core) Fix error bars for bar chart

Summary:
The culprit was `series = uniqXValues(series);` because it creates new
series objects when they are used as keys to access error bars info
(`errorBars.get(line)`).

Fixed by making uniqXValues mutating series instead.

Test Plan: Adds a case to test error bars with bar charts.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3198
This commit is contained in:
Cyprien P
2022-01-03 10:14:06 +01:00
parent 50821f655d
commit 89dc9334c3
2 changed files with 7 additions and 8 deletions

View File

@@ -802,7 +802,7 @@ function basicPlot(series: Series[], options: ChartOptions, dataOptions: Data):
// up on hover is different than the value on the y-axis. It seems that one is the sum of all
// values with same x-axis value, while the other is the last of them. To fix this, we force
// unique values for the x-axis.
series = uniqXValues(series);
uniqXValues(series);
}
return {