TimeSeries: Fix y-axis Yes/No and On/Off boolean units (#61207)

This commit is contained in:
Leon Sorokin 2023-01-10 00:04:50 -06:00 committed by GitHub
parent da18c89e91
commit a1609230f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 664 additions and 227 deletions

View File

@ -73,7 +73,7 @@ export function getDisplayProcessor(options?: DisplayProcessorOptions): DisplayP
}
const hasCurrencyUnit = unit?.startsWith('currency');
const hasBoolUnit = unit === 'bool';
const hasBoolUnit = isBooleanUnit(unit);
const isNumType = field.type === FieldType.number;
const isLocaleFormat = unit === 'locale';
const canTrimTrailingDecimalZeros =

View File

@ -130,6 +130,7 @@ export class UPlotAxisBuilder extends PlotConfigBuilder<AxisProps, Axis> {
const gridColor = theme.isDark ? 'rgba(240, 250, 255, 0.09)' : 'rgba(0, 10, 23, 0.09)';
// TODO: this is pretty flimsy now that scaleKey is composed from multiple parts :/
if (isBooleanUnit(scaleKey)) {
splits = [0, 1];
}