(core) mark first field as label (rather than x-axis) for two more chart types

Summary:
The reference to "X-AXIS" in scatter plot and Kaplan/Meier
configuration is misleading.

Test Plan: Extended a test

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3660
pull/311/head
Paul Fitzpatrick 2 years ago
parent db0b500197
commit 5b1fc20735

@ -53,6 +53,10 @@ function isPieLike(chartType: string) {
return ['pie', 'donut'].includes(chartType);
}
function firstFieldIsLabels(chartType: string) {
return ['pie', 'donut', 'kaplan_meier', 'scatter'].includes(chartType);
}
export function isNumericOnly(chartType: string) {
return ['bar', 'pie', 'donut', 'kaplan_meier', 'line', 'area', 'scatter'].includes(chartType);
}
@ -560,7 +564,7 @@ export class ChartConfig extends GrainJSDisposable {
// The label to show for the first field in the axis configurator.
private _firstFieldLabel = Computed.create(this, fromKo(this._section.chartTypeDef), (
(_use, chartType) => isPieLike(chartType) ? 'LABEL' : 'X-AXIS'
(_use, chartType) => firstFieldIsLabels(chartType) ? 'LABEL' : 'X-AXIS'
));
// A computed that returns `this._section.chartTypeDef` and that takes care of removing the group

Loading…
Cancel
Save