pub struct Bar {
pub name: String,
pub orientation: Orientation,
pub argument: f64,
pub value: f64,
pub base_offset: Option<f64>,
pub bar_width: f64,
pub stroke: Stroke,
pub fill: Color32,
}Expand description
One bar in a BarChart. Potentially floating, allowing stacked bar charts.
Width can be changed to allow variable-width histograms.
Fields§
§name: StringName of plot element in the diagram (annotated by default formatter)
orientation: OrientationWhich direction the bar faces in the diagram
argument: f64Position on the argument (input) axis – X if vertical, Y if horizontal
value: f64Position on the value (output) axis – Y if vertical, X if horizontal
base_offset: Option<f64>For stacked bars, this denotes where the bar starts. None if base axis
bar_width: f64Thickness of the bar
stroke: StrokeLine width and color
fill: Color32Fill color
Implementations§
source§impl Bar
impl Bar
sourcepub fn new(argument: f64, height: f64) -> Bar
pub fn new(argument: f64, height: f64) -> Bar
Create a bar. Its orientation is set by its BarChart parent.
argument: Position on the argument axis (X if vertical, Y if horizontal).value: Height of the bar (if vertical).
By default the bar is vertical and its base is at zero.
sourcepub fn base_offset(self, offset: f64) -> Bar
pub fn base_offset(self, offset: f64) -> Bar
Offset the base of the bar. This offset is on the Y axis for a vertical bar and on the X axis for a horizontal bar.
sourcepub fn horizontal(self) -> Bar
pub fn horizontal(self) -> Bar
Set orientation of the element as horizontal. Argument axis is Y.