XYChart: Use same auto-ranging logic for X and Y axes (#88584)

This commit is contained in:
Ryan Watts 2024-06-04 17:58:59 +01:00 committed by GitHub
parent cd3dab2736
commit f1dce0c7d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View File

@ -253,11 +253,11 @@ Set the y-axis to be centered on zero.
### Soft min and soft max
Set a **Soft min** or **soft max** option for better control of y-axis limits. By default, Grafana sets the range for the y-axis automatically based on the dataset.
Set a **Soft min** or **soft max** option for better control of all axes limits. By default, Grafana sets the range automatically based on the dataset.
**Soft min** and **soft max** settings can prevent small variations in the data from being magnified when it's mostly flat. In contrast, hard min and max values help prevent obscuring useful detail in the data by clipping intermittent spikes past a specific point.
To define hard limits of the y-axis, set standard min/max options. For more information, refer to [Configure standard options](ref:configure-standard-options).
To define hard limits of the axes, set standard min/max options. For more information, refer to [Configure standard options](ref:configure-standard-options).
![Label example](/static/img/docs/time-series-panel/axis-soft-min-max-7-4.png)

View File

@ -156,11 +156,6 @@ export class UPlotScaleBuilder extends PlotConfigBuilder<ScaleProps, Scale> {
let minMax: uPlot.Range.MinMax = [dataMin, dataMax];
// don't pad numeric x scales
if (scaleKey === 'x' && !isTime && distr === ScaleDistribution.Linear) {
return minMax;
}
// happens when all series on a scale are `show: false`, re-returning nulls will auto-disable axis
if (!hasFixedRange && dataMin == null && dataMax == null) {
return minMax;