pub struct Ohlc<X, O>where
X: Serialize + Clone,
O: Serialize + Clone,{ /* private fields */ }
Expand description
Construct an OHLC trace.
Examples
use plotly::Ohlc;
let trace = Ohlc::new(
vec!["2022-08-22", "2022-08-23"],
vec![5, 6],
vec![8, 10],
vec![2, 4],
vec![6, 7],
);
let expected = serde_json::json!({
"type": "ohlc",
"x": ["2022-08-22", "2022-08-23"],
"open": [5, 6],
"high": [8, 10],
"low": [2, 4],
"close": [6, 7]
});
assert_eq!(serde_json::to_value(trace).unwrap(), expected);
Implementations§
source§impl<X, O> Ohlc<X, O>where
X: Serialize + Clone,
O: Serialize + Clone,
impl<X, O> Ohlc<X, O>where X: Serialize + Clone, O: Serialize + Clone,
pub fn x(self, value: Vec<X>) -> Self
pub fn open(self, value: Vec<O>) -> Self
pub fn high(self, value: Vec<O>) -> Self
pub fn low(self, value: Vec<O>) -> Self
pub fn close(self, value: Vec<O>) -> Self
pub fn decreasing(self, value: Direction) -> Self
pub fn hover_info(self, value: HoverInfo) -> Self
pub fn hover_label(self, value: Label) -> Self
pub fn hover_text(self, value: impl AsRef<str>) -> Self
pub fn hover_text_array(self, value: Vec<impl AsRef<str>>) -> Self
pub fn increasing(self, value: Direction) -> Self
pub fn legend_group(self, value: impl AsRef<str>) -> Self
pub fn legend_group_title(self, value: LegendGroupTitle) -> Self
pub fn line(self, value: Line) -> Self
pub fn name(self, value: impl AsRef<str>) -> Self
pub fn opacity(self, value: f64) -> Self
pub fn show_legend(self, value: bool) -> Self
pub fn text(self, value: impl AsRef<str>) -> Self
pub fn text_array(self, value: Vec<impl AsRef<str>>) -> Self
pub fn tick_width(self, value: f64) -> Self
pub fn visible(self, value: Visible) -> Self
pub fn x_calendar(self, value: Calendar) -> Self
Trait Implementations§
source§impl<X, O> Clone for Ohlc<X, O>where
X: Serialize + Clone + Clone,
O: Serialize + Clone + Clone,
impl<X, O> Clone for Ohlc<X, O>where X: Serialize + Clone + Clone, O: Serialize + Clone + Clone,
source§impl<X, O> Debug for Ohlc<X, O>where
X: Serialize + Clone + Debug,
O: Serialize + Clone + Debug,
impl<X, O> Debug for Ohlc<X, O>where X: Serialize + Clone + Debug, O: Serialize + Clone + Debug,
Auto Trait Implementations§
impl<X, O> !RefUnwindSafe for Ohlc<X, O>
impl<X, O> Send for Ohlc<X, O>where O: Send, X: Send,
impl<X, O> Sync for Ohlc<X, O>where O: Sync, X: Sync,
impl<X, O> Unpin for Ohlc<X, O>where O: Unpin, X: Unpin,
impl<X, O> !UnwindSafe for Ohlc<X, O>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more