mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
XYChart/Trend: Fix min/max and units/decimals x-field overrides (#70214)
This commit is contained in:
parent
82c125d450
commit
66b0e6b77f
@ -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)),
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -92,9 +92,7 @@ export const TrendPanel = ({
|
||||
options={options}
|
||||
>
|
||||
{(config, alignedDataFrame) => {
|
||||
if (
|
||||
alignedDataFrame.fields.filter((f) => f.config.links !== undefined && f.config.links.length > 0).length > 0
|
||||
) {
|
||||
if (alignedDataFrame.fields.some((f) => Boolean(f.config.links?.length))) {
|
||||
alignedDataFrame = regenerateLinksSupplier(alignedDataFrame, info.frames!, replaceVariables, timeZone);
|
||||
}
|
||||
|
||||
|
@ -604,8 +604,7 @@ const prepConfig = (
|
||||
isTime: false,
|
||||
orientation: ScaleOrientation.Horizontal,
|
||||
direction: ScaleDirection.Right,
|
||||
min: xField.config.min,
|
||||
max: xField.config.max,
|
||||
range: (u, dataMin, dataMax) => [xField.config.min ?? dataMin, xField.config.max ?? dataMax],
|
||||
});
|
||||
|
||||
// why does this fall back to '' instead of null or undef?
|
||||
|
Loading…
Reference in New Issue
Block a user