pub enum Artist {
Line(LineArtist),
Scatter(ScatterArtist),
Bar(BarArtist),
Histogram(HistArtist),
FillBetween(FillBetweenArtist),
}Expand description
A visual element drawn on an axes.
Artist is the primary unit of chart content. Each variant wraps a
concrete artist struct that stores the data, colors, and styling needed
to render one visual element. The enum provides convenience accessors
(label, color,
data_bounds) that dispatch to the inner type.
Variants§
Line(LineArtist)
A line chart connecting (x, y) points.
Scatter(ScatterArtist)
A scatter plot of individual points.
Bar(BarArtist)
A bar chart (vertical or horizontal).
Histogram(HistArtist)
A histogram (binned frequency distribution).
FillBetween(FillBetweenArtist)
A filled region between two y-series sharing a common x-series.
Implementations§
Source§impl Artist
impl Artist
Sourcepub fn label(&self) -> Option<&str>
pub fn label(&self) -> Option<&str>
Returns the legend label for this artist, if one has been set.
The legend renderer uses this to decide which artists appear in the legend. Artists without a label are silently skipped.
Sourcepub fn color(&self) -> Color
pub fn color(&self) -> Color
Returns the primary color of this artist.
Used by the legend to draw a color swatch next to the label, and by any other component that needs to identify an artist’s color (e.g. tooltip rendering).
Sourcepub fn data_bounds(&self) -> (f64, f64, f64, f64)
pub fn data_bounds(&self) -> (f64, f64, f64, f64)
Returns the data-space bounding box as (xmin, xmax, ymin, ymax).
The axes autoscaling logic calls this on every artist to compute the
tightest axis limits that contain all visible data. If a series is
empty or contains no finite values, the corresponding min/max pair
falls back to (0.0, 1.0) so that the axes always have a non-zero
extent.