Skip to main content

Artist

Enum Artist 

Source
pub enum Artist {
Show 16 variants Line(LineArtist), Scatter(ScatterArtist), Bar(BarArtist), Histogram(HistArtist), FillBetween(FillBetweenArtist), Step(StepArtist), Stem(StemArtist), BoxPlot(BoxPlotArtist), ErrorBar(ErrorBarArtist), Heatmap(HeatmapArtist), Pie(PieArtist), Violin(ViolinArtist), Contour(ContourArtist), Polar(PolarArtist), Hexbin(HexbinArtist), Waterfall(WaterfallArtist),
}
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.

§

Step(StepArtist)

A step (staircase) chart connecting data points.

§

Stem(StemArtist)

A stem (lollipop) chart from data points.

§

BoxPlot(BoxPlotArtist)

A box-and-whisker plot showing distribution summaries.

§

ErrorBar(ErrorBarArtist)

An error bar plot showing data points with uncertainty bars.

§

Heatmap(HeatmapArtist)

A heatmap showing a 2D grid of values mapped to colors.

§

Pie(PieArtist)

A pie chart showing proportional wedge slices.

§

Violin(ViolinArtist)

A violin plot showing kernel density estimates of distributions.

§

Contour(ContourArtist)

A contour or filled contour plot over a 2D grid.

§

Polar(PolarArtist)

A polar line or filled radar chart in polar coordinates.

§

Hexbin(HexbinArtist)

A hexagonal binning plot showing point density as colored hexagons.

§

Waterfall(WaterfallArtist)

A waterfall chart showing cumulative positive and negative changes.

Implementations§

Source§

impl Artist

Source

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.

Source

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).

Source

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.

Trait Implementations§

Source§

impl Clone for Artist

Source§

fn clone(&self) -> Artist

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Artist

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.