pub struct Bar<X, Y>where
X: Serialize + Clone,
Y: Serialize + Clone,{ /* private fields */ }
Expand description
Construct a bar trace.
Examples
use plotly::Bar;
let x = vec![0, 1, 2, 3, 4, 5];
let y = vec![0, 2, 4, 6, 8, 10];
let trace = Bar::new(x, y).show_legend(true).opacity(0.5);
let expected = serde_json::json!({
"type": "bar",
"x": [0, 1, 2, 3, 4, 5],
"y": [0, 2, 4, 6, 8, 10],
"showlegend": true,
"opacity": 0.5
});
assert_eq!(serde_json::to_value(trace).unwrap(), expected);
Implementations§
source§impl<X, Y> Bar<X, Y>where
X: Serialize + Clone,
Y: Serialize + Clone,
impl<X, Y> Bar<X, Y>where X: Serialize + Clone, Y: Serialize + Clone,
pub fn x(self, value: Vec<X>) -> Box<Self>
sourcepub fn modify_all_x(value: Vec<X>) -> RestyleBar<X, Y>
pub fn modify_all_x(value: Vec<X>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_x(values: Vec<Vec<X>>) -> RestyleBar<X, Y>
pub fn modify_x(values: Vec<Vec<X>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn y(self, value: Vec<Y>) -> Box<Self>
sourcepub fn modify_all_y(value: Vec<Y>) -> RestyleBar<X, Y>
pub fn modify_all_y(value: Vec<Y>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_y(values: Vec<Vec<Y>>) -> RestyleBar<X, Y>
pub fn modify_y(values: Vec<Vec<Y>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn name(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_name(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_name(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_name(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_name(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn visible(self, value: Visible) -> Box<Self>
sourcepub fn modify_all_visible(value: Visible) -> RestyleBar<X, Y>
pub fn modify_all_visible(value: Visible) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_visible(values: Vec<Visible>) -> RestyleBar<X, Y>
pub fn modify_visible(values: Vec<Visible>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn show_legend(self, value: bool) -> Box<Self>
sourcepub fn modify_all_show_legend(value: bool) -> RestyleBar<X, Y>
pub fn modify_all_show_legend(value: bool) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_show_legend(values: Vec<bool>) -> RestyleBar<X, Y>
pub fn modify_show_legend(values: Vec<bool>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn legend_group(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_legend_group(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_legend_group(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_legend_group(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_legend_group(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn legend_group_title(self, value: LegendGroupTitle) -> Box<Self>
sourcepub fn modify_all_legend_group_title(
value: LegendGroupTitle
) -> RestyleBar<X, Y>
pub fn modify_all_legend_group_title( value: LegendGroupTitle ) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_legend_group_title(
values: Vec<LegendGroupTitle>
) -> RestyleBar<X, Y>
pub fn modify_legend_group_title( values: Vec<LegendGroupTitle> ) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn opacity(self, value: f64) -> Box<Self>
sourcepub fn modify_all_opacity(value: f64) -> RestyleBar<X, Y>
pub fn modify_all_opacity(value: f64) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_opacity(values: Vec<f64>) -> RestyleBar<X, Y>
pub fn modify_opacity(values: Vec<f64>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn ids(self, value: Vec<impl AsRef<str>>) -> Box<Self>
sourcepub fn modify_all_ids(value: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_all_ids(value: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_ids(values: Vec<Vec<impl AsRef<str>>>) -> RestyleBar<X, Y>
pub fn modify_ids(values: Vec<Vec<impl AsRef<str>>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn width(self, value: usize) -> Box<Self>
sourcepub fn modify_all_width(value: usize) -> RestyleBar<X, Y>
pub fn modify_all_width(value: usize) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_width(values: Vec<usize>) -> RestyleBar<X, Y>
pub fn modify_width(values: Vec<usize>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn offset(self, value: usize) -> Box<Self>
sourcepub fn modify_all_offset(value: usize) -> RestyleBar<X, Y>
pub fn modify_all_offset(value: usize) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_offset(values: Vec<usize>) -> RestyleBar<X, Y>
pub fn modify_offset(values: Vec<usize>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn offset_array(self, value: Vec<usize>) -> Box<Self>
pub fn text(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_text(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_text(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_text(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_text(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn text_array(self, value: Vec<impl AsRef<str>>) -> Box<Self>
pub fn text_position(self, value: TextPosition) -> Box<Self>
sourcepub fn modify_all_text_position(value: TextPosition) -> RestyleBar<X, Y>
pub fn modify_all_text_position(value: TextPosition) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_text_position(values: Vec<TextPosition>) -> RestyleBar<X, Y>
pub fn modify_text_position(values: Vec<TextPosition>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn text_position_array(self, value: Vec<TextPosition>) -> Box<Self>
pub fn text_template(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_text_template(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_text_template(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_text_template(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_text_template(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn text_template_array(self, value: Vec<impl AsRef<str>>) -> Box<Self>
pub fn hover_text(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_hover_text(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_hover_text(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_hover_text(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_hover_text(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn hover_text_array(self, value: Vec<impl AsRef<str>>) -> Box<Self>
pub fn hover_info(self, value: HoverInfo) -> Box<Self>
sourcepub fn modify_all_hover_info(value: HoverInfo) -> RestyleBar<X, Y>
pub fn modify_all_hover_info(value: HoverInfo) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_hover_info(values: Vec<HoverInfo>) -> RestyleBar<X, Y>
pub fn modify_hover_info(values: Vec<HoverInfo>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn hover_template(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_hover_template(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_hover_template(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_hover_template(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_hover_template(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn hover_template_array(self, value: Vec<impl AsRef<str>>) -> Box<Self>
pub fn x_axis(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_x_axis(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_x_axis(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_x_axis(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_x_axis(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn y_axis(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_y_axis(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_y_axis(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_y_axis(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_y_axis(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn orientation(self, value: Orientation) -> Box<Self>
sourcepub fn modify_all_orientation(value: Orientation) -> RestyleBar<X, Y>
pub fn modify_all_orientation(value: Orientation) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_orientation(values: Vec<Orientation>) -> RestyleBar<X, Y>
pub fn modify_orientation(values: Vec<Orientation>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn alignment_group(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_alignment_group(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_alignment_group(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_alignment_group(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_alignment_group(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn offset_group(self, value: impl AsRef<str>) -> Box<Self>
sourcepub fn modify_all_offset_group(value: impl AsRef<str>) -> RestyleBar<X, Y>
pub fn modify_all_offset_group(value: impl AsRef<str>) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_offset_group(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
pub fn modify_offset_group(values: Vec<impl AsRef<str>>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn marker(self, value: Marker) -> Box<Self>
sourcepub fn modify_all_marker(value: Marker) -> RestyleBar<X, Y>
pub fn modify_all_marker(value: Marker) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_marker(values: Vec<Marker>) -> RestyleBar<X, Y>
pub fn modify_marker(values: Vec<Marker>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn text_angle(self, value: f64) -> Box<Self>
sourcepub fn modify_all_text_angle(value: f64) -> RestyleBar<X, Y>
pub fn modify_all_text_angle(value: f64) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_text_angle(values: Vec<f64>) -> RestyleBar<X, Y>
pub fn modify_text_angle(values: Vec<f64>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn text_font(self, value: Font) -> Box<Self>
sourcepub fn modify_all_text_font(value: Font) -> RestyleBar<X, Y>
pub fn modify_all_text_font(value: Font) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_text_font(values: Vec<Font>) -> RestyleBar<X, Y>
pub fn modify_text_font(values: Vec<Font>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn error_x(self, value: ErrorData) -> Box<Self>
sourcepub fn modify_all_error_x(value: ErrorData) -> RestyleBar<X, Y>
pub fn modify_all_error_x(value: ErrorData) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_error_x(values: Vec<ErrorData>) -> RestyleBar<X, Y>
pub fn modify_error_x(values: Vec<ErrorData>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn error_y(self, value: ErrorData) -> Box<Self>
sourcepub fn modify_all_error_y(value: ErrorData) -> RestyleBar<X, Y>
pub fn modify_all_error_y(value: ErrorData) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_error_y(values: Vec<ErrorData>) -> RestyleBar<X, Y>
pub fn modify_error_y(values: Vec<ErrorData>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn clip_on_axis(self, value: bool) -> Box<Self>
sourcepub fn modify_all_clip_on_axis(value: bool) -> RestyleBar<X, Y>
pub fn modify_all_clip_on_axis(value: bool) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_clip_on_axis(values: Vec<bool>) -> RestyleBar<X, Y>
pub fn modify_clip_on_axis(values: Vec<bool>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn constrain_text(self, value: ConstrainText) -> Box<Self>
sourcepub fn modify_all_constrain_text(value: ConstrainText) -> RestyleBar<X, Y>
pub fn modify_all_constrain_text(value: ConstrainText) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_constrain_text(values: Vec<ConstrainText>) -> RestyleBar<X, Y>
pub fn modify_constrain_text(values: Vec<ConstrainText>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn hover_label(self, value: Label) -> Box<Self>
sourcepub fn modify_all_hover_label(value: Label) -> RestyleBar<X, Y>
pub fn modify_all_hover_label(value: Label) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_hover_label(values: Vec<Label>) -> RestyleBar<X, Y>
pub fn modify_hover_label(values: Vec<Label>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn inside_text_anchor(self, value: TextAnchor) -> Box<Self>
sourcepub fn modify_all_inside_text_anchor(value: TextAnchor) -> RestyleBar<X, Y>
pub fn modify_all_inside_text_anchor(value: TextAnchor) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_inside_text_anchor(values: Vec<TextAnchor>) -> RestyleBar<X, Y>
pub fn modify_inside_text_anchor(values: Vec<TextAnchor>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn inside_text_font(self, value: Font) -> Box<Self>
sourcepub fn modify_all_inside_text_font(value: Font) -> RestyleBar<X, Y>
pub fn modify_all_inside_text_font(value: Font) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_inside_text_font(values: Vec<Font>) -> RestyleBar<X, Y>
pub fn modify_inside_text_font(values: Vec<Font>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn outside_text_font(self, value: Font) -> Box<Self>
sourcepub fn modify_all_outside_text_font(value: Font) -> RestyleBar<X, Y>
pub fn modify_all_outside_text_font(value: Font) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_outside_text_font(values: Vec<Font>) -> RestyleBar<X, Y>
pub fn modify_outside_text_font(values: Vec<Font>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn x_calendar(self, value: Calendar) -> Box<Self>
sourcepub fn modify_all_x_calendar(value: Calendar) -> RestyleBar<X, Y>
pub fn modify_all_x_calendar(value: Calendar) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_x_calendar(values: Vec<Calendar>) -> RestyleBar<X, Y>
pub fn modify_x_calendar(values: Vec<Calendar>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces
pub fn y_calendar(self, value: Calendar) -> Box<Self>
sourcepub fn modify_all_y_calendar(value: Calendar) -> RestyleBar<X, Y>
pub fn modify_all_y_calendar(value: Calendar) -> RestyleBar<X, Y>
Apply the same restyling to all the traces
sourcepub fn modify_y_calendar(values: Vec<Calendar>) -> RestyleBar<X, Y>
pub fn modify_y_calendar(values: Vec<Calendar>) -> RestyleBar<X, Y>
Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces