From 0da397ab9018e16414d20396d9aa8e965531845e Mon Sep 17 00:00:00 2001 From: Cyprien P Date: Wed, 23 Feb 2022 13:19:10 +0100 Subject: [PATCH] (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 --- app/client/components/ChartView.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/components/ChartView.ts b/app/client/components/ChartView.ts index 0051b4a3..1a5d2fc3 100644 --- a/app/client/components/ChartView.ts +++ b/app/client/components/ChartView.ts @@ -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.