[v10.0.x] XYChart/Trend: Fix min/max and units/decimals X field overrides (#70261)
XYChart/Trend: Fix min/max and units/decimals x-field overrides (#70214)
(cherry picked from commit 66b0e6b77f)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
co-authored by
Leon Sorokin
parent
edd4faf064
commit
af98396285
@@ -181,6 +181,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<{
|
||||
scaleKey: xScaleKey,
|
||||
orientation: ScaleOrientation.Horizontal,
|
||||
direction: ScaleDirection.Right,
|
||||
range: (u, dataMin, dataMax) => [xField.config.min ?? dataMin, xField.config.max ?? dataMax],
|
||||
});
|
||||
|
||||
builder.addAxis({
|
||||
@@ -190,6 +191,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<{
|
||||
label: xField.config.custom?.axisLabel,
|
||||
theme,
|
||||
grid: { show: xField.config.custom?.axisGridShow },
|
||||
formatValue: (v, decimals) => formattedValueToString(xField.display!(v, decimals)),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user