diff --git a/plotly/src/common/mod.rs b/plotly/src/common/mod.rs index fc98e6e9..44fece3a 100644 --- a/plotly/src/common/mod.rs +++ b/plotly/src/common/mod.rs @@ -750,6 +750,7 @@ pub struct ColorBar { len_mode: Option, #[serde(rename = "nticks")] n_ticks: Option, + orientation: Option, #[serde(rename = "outlinecolor")] outline_color: Option>, #[serde(rename = "outlinewidth")] @@ -852,6 +853,11 @@ impl ColorBar { self } + pub fn orientation(mut self, orientation: Orientation) -> Self { + self.orientation = Some(orientation); + self + } + pub fn outline_color(mut self, outline_color: C) -> Self { self.outline_color = Some(Box::new(outline_color)); self @@ -1662,6 +1668,7 @@ mod tests { .len(99) .len_mode(ThicknessMode::Pixels) .n_ticks(500) + .orientation(Orientation::Horizontal) .outline_color("#789456") .outline_width(7) .separate_thousands(true) @@ -1702,6 +1709,7 @@ mod tests { "len": 99, "lenmode": "pixels", "nticks": 500, + "orientation": "h", "outlinecolor": "#789456", "outlinewidth": 7, "separatethousands": true,