pub struct Candlestick<T, O>{ /* private fields */ }
Expand description
Construct a candlestick trace.
§Examples
use plotly::Candlestick;
let x = vec!["2020-05-22", "2020-05-23"];
let open = vec![5, 6];
let high = vec![9, 10];
let low = vec![3, 5];
let close = vec![6, 9];
let trace = Candlestick::new(x, open, high, low, close)
.name("trace_1")
.show_legend(true);
let expected = serde_json::json!({
"type": "candlestick",
"x": ["2020-05-22", "2020-05-23"],
"open": [5, 6],
"high": [9, 10],
"low": [3, 5],
"close": [6, 9],
"increasing": {"line": {"color": "green", "width": 1.0}},
"decreasing": {"line": {"color": "red", "width": 1.0}},
"name": "trace_1",
"showlegend": true
});
assert_eq!(serde_json::to_value(trace).unwrap(), expected);
Implementations§
Source§impl<T, O> Candlestick<T, O>
impl<T, O> Candlestick<T, O>
pub fn x(self, value: Vec<T>) -> 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 name(self, value: impl AsRef<str>) -> Self
pub fn visible(self, value: Visible) -> Self
pub fn show_legend(self, value: bool) -> Self
pub fn legend_group(self, value: impl AsRef<str>) -> Self
pub fn legend_group_title(self, value: impl Into<LegendGroupTitle>) -> Self
pub fn opacity(self, value: f64) -> Self
pub fn text(self, value: impl AsRef<str>) -> Self
pub fn text_array(self, value: Vec<impl AsRef<str>>) -> 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 hover_info(self, value: HoverInfo) -> Self
pub fn x_axis(self, value: impl AsRef<str>) -> Self
pub fn y_axis(self, value: impl AsRef<str>) -> Self
pub fn line(self, value: Line) -> Self
pub fn whisker_width(self, value: f64) -> Self
pub fn increasing(self, value: Direction) -> Self
pub fn decreasing(self, value: Direction) -> Self
pub fn hover_label(self, value: Label) -> Self
pub fn x_calendar(self, value: Calendar) -> Self
Trait Implementations§
Source§impl<T, O> Clone for Candlestick<T, O>
impl<T, O> Clone for Candlestick<T, O>
Source§fn clone(&self) -> Candlestick<T, O>
fn clone(&self) -> Candlestick<T, O>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T, O> Debug for Candlestick<T, O>
impl<T, O> Debug for Candlestick<T, O>
Source§impl<T, O> Default for Candlestick<T, O>
impl<T, O> Default for Candlestick<T, O>
Source§impl<T, O> Serialize for Candlestick<T, O>
impl<T, O> Serialize for Candlestick<T, O>
Auto Trait Implementations§
impl<T, O> Freeze for Candlestick<T, O>
impl<T, O> !RefUnwindSafe for Candlestick<T, O>
impl<T, O> Send for Candlestick<T, O>
impl<T, O> Sync for Candlestick<T, O>
impl<T, O> Unpin for Candlestick<T, O>
impl<T, O> !UnwindSafe for Candlestick<T, 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