@@ -750,6 +750,7 @@ pub struct ColorBar {
750
750
len_mode : Option < ThicknessMode > ,
751
751
#[ serde( rename = "nticks" ) ]
752
752
n_ticks : Option < usize > ,
753
+ orientation : Option < Orientation > ,
753
754
#[ serde( rename = "outlinecolor" ) ]
754
755
outline_color : Option < Box < dyn Color > > ,
755
756
#[ serde( rename = "outlinewidth" ) ]
@@ -852,6 +853,11 @@ impl ColorBar {
852
853
self
853
854
}
854
855
856
+ pub fn orientation ( mut self , orientation : Orientation ) -> Self {
857
+ self . orientation = Some ( orientation) ;
858
+ self
859
+ }
860
+
855
861
pub fn outline_color < C : Color > ( mut self , outline_color : C ) -> Self {
856
862
self . outline_color = Some ( Box :: new ( outline_color) ) ;
857
863
self
@@ -1662,6 +1668,7 @@ mod tests {
1662
1668
. len ( 99 )
1663
1669
. len_mode ( ThicknessMode :: Pixels )
1664
1670
. n_ticks ( 500 )
1671
+ . orientation ( Orientation :: Horizontal )
1665
1672
. outline_color ( "#789456" )
1666
1673
. outline_width ( 7 )
1667
1674
. separate_thousands ( true )
@@ -1702,6 +1709,7 @@ mod tests {
1702
1709
"len" : 99 ,
1703
1710
"lenmode" : "pixels" ,
1704
1711
"nticks" : 500 ,
1712
+ "orientation" : "h" ,
1705
1713
"outlinecolor" : "#789456" ,
1706
1714
"outlinewidth" : 7 ,
1707
1715
"separatethousands" : true ,
0 commit comments