[v11.3.x] BarChart: Skip formatting null-valued ticks (#95094)
BarChart: Skip formatting null-valued ticks (#94935)
Co-authored-by: Ihor Yeromin <yeryomin.igor@gmail.com>
(cherry picked from commit 594e9b1b73)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
co-authored by
Leon Sorokin
parent
a2db7105a9
commit
367c82bd51
@@ -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);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user