pub struct LineChart { /* private fields */ }Expand description
Multi-series Cartesian curves using caller-supplied linear/log scales. The plot rectangle excludes tick labels. Their placement viewport extends 96 pixels to either side, 40 above and 72 below the plot; reserve surrounding space. Curves/grid are clipped to the plot, while labels remain outside that clip.
Implementations§
Source§impl LineChart
impl LineChart
Sourcepub fn node(&self, context: &SceneContext<'_>) -> Result<Node>
pub fn node(&self, context: &SceneContext<'_>) -> Result<Node>
Builds curves/grid and project-font measured tick labels without system-font discovery. Curves use paints and stroke styles.
Sourcepub fn new(
bounds: Rect,
horizontal: Scale,
vertical: Scale,
) -> Result<Self, ValidationError>
pub fn new( bounds: Rect, horizontal: Scale, vertical: Scale, ) -> Result<Self, ValidationError>
Requires each scale range to match its plot edges, in either direction.
Sourcepub fn ticks(self, count: usize) -> Result<Self, ValidationError>
pub fn ticks(self, count: usize) -> Result<Self, ValidationError>
Replaces the maximum number of nice ticks per axis, in 2..=32.
Sourcepub fn series(
self,
points: impl IntoIterator<Item = (f64, f64)>,
paint: impl Into<Paint>,
stroke: StrokeStyle,
) -> Result<Self, ValidationError>
pub fn series( self, points: impl IntoIterator<Item = (f64, f64)>, paint: impl Into<Paint>, stroke: StrokeStyle, ) -> Result<Self, ValidationError>
Adds a curve; all points must be finite and valid in both scales.
Sourcepub fn gapped_series(
self,
points: impl IntoIterator<Item = Option<(f64, f64)>>,
paint: impl Into<Paint>,
stroke: StrokeStyle,
) -> Result<Self, ValidationError>
pub fn gapped_series( self, points: impl IntoIterator<Item = Option<(f64, f64)>>, paint: impl Into<Paint>, stroke: StrokeStyle, ) -> Result<Self, ValidationError>
Adds a curve where None breaks the path rather than connecting missing data.
At most 32 series and 65536 total entries (including gaps) are retained.