pub struct BarChart { /* private fields */ }
Expand description
A bar chart.
Implementations
sourceimpl BarChart
impl BarChart
sourcepub fn new(bars: Vec<Bar, Global>) -> BarChart
pub fn new(bars: Vec<Bar, Global>) -> BarChart
Create a bar chart. It defaults to vertically oriented elements.
sourcepub fn color(self, color: impl Into<Color32>) -> BarChart
pub fn color(self, color: impl Into<Color32>) -> BarChart
Set the default color. It is set on all elements that do not already have a specific color.
This is the color that shows up in the legend.
It can be overridden at the bar level (see [Bar
]).
Default is Color32::TRANSPARENT
which means a color will be auto-assigned.
sourcepub fn name(self, name: impl ToString) -> BarChart
pub fn name(self, name: impl ToString) -> BarChart
Name of this chart.
This name will show up in the plot legend, if legends are turned on. Multiple charts may share the same name, in which case they will also share an entry in the legend.
sourcepub fn vertical(self) -> BarChart
pub fn vertical(self) -> BarChart
Set all elements to be in a vertical orientation. Argument axis will be X and bar values will be on the Y axis.
sourcepub fn horizontal(self) -> BarChart
pub fn horizontal(self) -> BarChart
Set all elements to be in a horizontal orientation. Argument axis will be Y and bar values will be on the X axis.