(core) Fix js error when changing X Axis with chart with no series

Summary:
This error only occured for certain charts type. Some chart handled it correctly, others did not.

This brings a more general handling of this issue which should work for all charts.

Test Plan: New nbrowser test case.

Reviewers: jarek

Reviewed By: jarek

Subscribers: jarek

Differential Revision: https://phab.getgrist.com/D3303
This commit is contained in:
Cyprien P 2022-02-23 13:19:10 +01:00
parent 5213972d24
commit 0da397ab90

View File

@ -288,7 +288,7 @@ export class ChartView extends Disposable {
dataOptions.totalFormatter = this._formatterComp.peek();
}
if (!options.multiseries) {
if (!options.multiseries && series.length) {
plotData = chartFunc(series, options, dataOptions);
} else if (series.length > 1) {
// We need to group all series by the first column.