pub struct LineChartStyle<C: PixelColor> {
pub line_color: C,
pub line_width: u32,
pub fill_area: bool,
pub fill_color: Option<C>,
pub markers: Option<MarkerStyle<C>>,
pub smooth: bool,
pub smooth_subdivisions: u32,
}Expand description
Style configuration for line charts.
This structure contains all visual styling options for line charts, including line appearance, markers, and area fills.
§Examples
use embedded_charts::prelude::*;
use embedded_graphics::pixelcolor::Rgb565;
let style = LineChartStyle {
line_color: Rgb565::BLUE,
line_width: 2,
fill_area: true,
fill_color: Some(Rgb565::CSS_LIGHT_BLUE),
markers: Some(MarkerStyle::default()),
smooth: false,
smooth_subdivisions: 8,
};Fields§
§line_color: CColor of the line connecting data points.
line_width: u32Width of the line in pixels (recommended range: 1-10).
Larger widths may impact performance on resource-constrained devices.
fill_area: boolWhether to fill the area under the line.
When enabled, creates a filled polygon from the line to the chart baseline.
fill_color: Option<C>Fill color for the area under the line.
Only used when fill_area is true. If None, no fill is drawn.
markers: Option<MarkerStyle<C>>Marker style for data points.
When Some, markers are drawn at each data point. When None, no markers are shown.
smooth: boolWhether to smooth the line using interpolation.
When enabled, creates smooth curves between data points instead of straight lines. Uses Catmull-Rom spline interpolation for balanced smoothness and performance. This feature may impact performance and is recommended for larger displays.
smooth_subdivisions: u32Number of subdivisions for smooth curves (only used when smooth = true)
Trait Implementations§
Source§impl<C: Clone + PixelColor> Clone for LineChartStyle<C>
impl<C: Clone + PixelColor> Clone for LineChartStyle<C>
Source§fn clone(&self) -> LineChartStyle<C>
fn clone(&self) -> LineChartStyle<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more