[v9.3.x] TimeSeries: Fix y-axis Yes/No and On/Off boolean units (#61208)

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

(cherry picked from commit a1609230f8)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2023-01-10 02:04:08 -05:00
committed by GitHub
co-authored by Leon Sorokin
parent 007110c599
commit 62984d2aa0
2 changed files with 2 additions and 1 deletions
@@ -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 =
@@ -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];
}