File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ class Gauge(Graph):
2828
2929 needle_width = 1 / 20
3030
31+ def __init__ (self , * args , reverse_direction = False , ** kwargs ):
32+ """Initialize the gauge with direction configuration"""
33+ super (Gauge , self ).__init__ (* args , ** kwargs )
34+ self .reverse_direction = reverse_direction
35+
3136 def _set_view (self ):
3237 """Assign a view to current graph"""
3338 if self .logarithmic :
@@ -132,7 +137,10 @@ def _compute(self):
132137 self .min_ -= 1
133138 self .max_ += 1
134139
135- self ._box .set_polar_box (0 , 1 , self .min_ , self .max_ )
140+ if self .reverse_direction :
141+ self ._box .set_polar_box (0 , 1 , self .max_ , self .min_ )
142+ else :
143+ self ._box .set_polar_box (0 , 1 , self .min_ , self .max_ )
136144
137145 def _compute_x_labels (self ):
138146 pass
You can’t perform that action at this time.
0 commit comments