#[non_exhaustive]pub struct Plot {Show 15 fields
pub layers: Vec<Layer>,
pub labels: Vec<ChartLabel>,
pub spots: Vec<Spot>,
pub marks: Vec<Mark>,
pub sectors: Vec<Sector>,
pub area: Rect,
pub bars: Vec<Bar>,
pub candles: Vec<Candle>,
pub rules: Vec<Rule>,
pub top_rules: Vec<Rule>,
pub backdrop: usize,
pub notes: Vec<usize>,
pub data_labels: Vec<usize>,
pub baseline: Option<f32>,
pub uncut_rules: Vec<Rule>,
}Expand description
A chart laid out.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.layers: Vec<Layer>What to draw, back to front.
labels: Vec<ChartLabel>The text, to draw over the layers.
spots: Vec<Spot>The categories of a chart with axes.
marks: Vec<Mark>Where each value landed.
sectors: Vec<Sector>The slices of a round chart.
area: RectWhere the data is, inside the axes.
bars: Vec<Bar>The bars of a bar chart.
candles: Vec<Candle>The candles of a ChartKind::Candlestick, when PlotStyle::bars_apart leaves
them out of the layers.
rules: Vec<Rule>Gridlines, behind the layers, when PlotStyle::rules_apart asks for them.
top_rules: Vec<Rule>Lines of reference, over the layers, when PlotStyle::rules_apart asks for them.
backdrop: usizeHow many of the first layers are the backdrop the data is drawn over, such as the rings and spokes of a radar, which stay put while the data draws in.
notes: Vec<usize>The layers that only point at the data, such as the guide from a slice to its label: they come in with the labels, once the data is nearly whole.
data_labels: Vec<usize>The labels that belong to the data, such as a bar’s value, and not to an axis.
baseline: Option<f32>Where the value axis has its zero, inside the area: what bars grow out of.
uncut_rules: Vec<Rule>The gridlines before Self::rules stopped at the bars, for bars of another
length, such as while they grow, to cut them again with rules_around_bars.
Implementations§
Source§impl Plot
impl Plot
Sourcepub fn hit(&self, point: Point) -> Option<Hit>
pub fn hit(&self, point: Point) -> Option<Hit>
What is under point, in the coordinates the chart was laid out in.
Sourcepub fn over_grown_slice(&self, point: Point, index: usize, by: f32) -> bool
pub fn over_grown_slice(&self, point: Point, index: usize, by: f32) -> bool
Whether point is over the slice of this category, once it has grown by by.
Sourcepub fn categories(&self) -> usize
pub fn categories(&self) -> usize
Whether this category has any place on the chart, and how many there are.