Skip to content

Commit 4f2e7a6

Browse files
committed
feat(observability-lib): add AxisSoftMin and AxisSoftMax options
Add support for configurable soft min/max axis values in time series panels. Soft limits suggest axis bounds while allowing data outside the range to remain visible, improving visualization consistency across dashboards.
1 parent 3d788b3 commit 4f2e7a6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

observability-lib/grafana/panels.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ type TimeSeriesPanelOptions struct {
326326
ThresholdStyle common.GraphThresholdsStyleMode
327327
DrawStyle common.GraphDrawStyle
328328
StackingMode common.StackingMode
329+
AxisSoftMin *float64
330+
AxisSoftMax *float64
329331
}
330332

331333
func NewTimeSeriesPanel(options *TimeSeriesPanelOptions) *Panel {
@@ -392,6 +394,14 @@ func NewTimeSeriesPanel(options *TimeSeriesPanelOptions) *Panel {
392394
newPanel.Max(*options.Max)
393395
}
394396

397+
if options.AxisSoftMin != nil {
398+
newPanel.AxisSoftMin(*options.AxisSoftMin)
399+
}
400+
401+
if options.AxisSoftMax != nil {
402+
newPanel.AxisSoftMax(*options.AxisSoftMax)
403+
}
404+
395405
for _, q := range options.Query {
396406
newPanel.WithTarget(newQuery(q))
397407
}

0 commit comments

Comments
 (0)