Skip to content

Commit

Permalink
Add 'auto' to the list of accepted orientations for BarGauge. (#635)
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Christopher <[email protected]>
  • Loading branch information
alan-christopher and Alan Christopher authored Jan 12, 2024
1 parent 715cacd commit b110aef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Changelog
* Added unit parameter to the Table class in core
* Added a hide parameter to ElasticsearchTarget
* Fix value literal GAUGE_CALC_TOTAL to sum instead of total
* Fix `BarGauge` orientation validation to accept `'auto'`

0.7.0 (2022-10-02)
==================
Expand Down
5 changes: 4 additions & 1 deletion grafanalib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def to_json_data(self):

ORIENTATION_HORIZONTAL = 'horizontal'
ORIENTATION_VERTICAL = 'vertical'
ORIENTATION_AUTO = 'auto'

GAUGE_DISPLAY_MODE_BASIC = 'basic'
GAUGE_DISPLAY_MODE_LCD = 'lcd'
Expand Down Expand Up @@ -3371,7 +3372,9 @@ class BarGauge(Panel):
min = attr.ib(default=0)
orientation = attr.ib(
default=ORIENTATION_HORIZONTAL,
validator=in_([ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL]),
validator=in_([ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL,
ORIENTATION_AUTO]),
)
rangeMaps = attr.ib(default=attr.Factory(list))
thresholdLabels = attr.ib(default=False, validator=instance_of(bool))
Expand Down

0 comments on commit b110aef

Please sign in to comment.