BarChart: Skip formatting null-valued ticks (#94935)

Co-authored-by: Ihor Yeromin <yeryomin.igor@gmail.com>
This commit is contained in:
Leon Sorokin
2024-10-21 22:29:51 +03:00
committed by GitHub
co-authored by Ihor Yeromin
parent 5c06bbf8cf
commit 594e9b1b73
@@ -168,7 +168,13 @@ export class UPlotAxisBuilder extends PlotConfigBuilder<AxisProps, Axis> {
} else if (formatValue) {
config.values = (u: uPlot, splits, axisIdx, tickSpace, tickIncr) => {
let decimals = guessDecimals(roundDecimals(tickIncr, 6));
return splits.map((v) => formatValue!(v, decimals > 0 ? decimals : undefined));
return splits.map((v) => {
if (v == null) {
return null;
} else {
return formatValue!(v, decimals > 0 ? decimals : undefined);
}
});
};
}