pub struct BarChartStyle<C: PixelColor> {
pub bar_colors: Vec<C, 16>,
pub bar_width: BarWidth,
pub spacing: u32,
pub border: Option<BorderStyle<C>>,
pub stacked: bool,
}Expand description
Style configuration for bar charts.
This structure contains all visual styling options for bar charts, including colors, dimensions, spacing, and border styles.
§Examples
use embedded_charts::prelude::*;
use embedded_graphics::pixelcolor::Rgb565;
let mut colors = heapless::Vec::new();
colors.push(Rgb565::BLUE).unwrap();
colors.push(Rgb565::RED).unwrap();
let style = BarChartStyle {
bar_colors: colors,
bar_width: BarWidth::Fixed(20),
spacing: 5,
border: None,
stacked: false,
};Fields§
§bar_colors: Vec<C, 16>Colors for the bars.
The chart cycles through these colors for multiple data series. Maximum of 16 colors supported for memory efficiency.
bar_width: BarWidthWidth configuration for bars.
Determines how bar widths are calculated based on available space.
spacing: u32Spacing between bars in pixels.
This spacing is applied between individual bars and between groups in multi-series charts.
border: Option<BorderStyle<C>>Optional border style for bars.
When Some, draws borders around each bar with the specified style.
When None, bars are drawn without borders.
stacked: boolWhether bars should be stacked.
When true, multiple data series are stacked on top of each other.
When false, series are displayed side by side.
Trait Implementations§
Source§impl<C: Clone + PixelColor> Clone for BarChartStyle<C>
impl<C: Clone + PixelColor> Clone for BarChartStyle<C>
Source§fn clone(&self) -> BarChartStyle<C>
fn clone(&self) -> BarChartStyle<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more