#[non_exhaustive]pub struct PlotStyle {Show 55 fields
pub kind: ChartKind,
pub colors: Vec<Color>,
pub item_colors: Vec<Color>,
pub ink: Color,
pub muted: Color,
pub grid: Color,
pub surface: Color,
pub track: Color,
pub size: f32,
pub curve: Curve,
pub stack: Stack,
pub gradient: bool,
pub fill_opacity: f32,
pub horizontal: bool,
pub reversed: bool,
pub min_bar: f32,
pub labels_at_zero: bool,
pub bar_radius: f32,
pub max_bar: f32,
pub negative: Option<Color>,
pub rising: Color,
pub falling: Color,
pub active: Option<usize>,
pub dots: bool,
pub value_labels: Option<LabelAt>,
pub category_labels: Option<LabelAt>,
pub format: Rc<dyn Fn(f64) -> String>,
pub tick_format: Rc<dyn Fn(&str) -> String>,
pub grid_lines: Grid,
pub category_axis: bool,
pub value_axis: bool,
pub tight_scale: bool,
pub separator: f32,
pub slice_radii: Vec<f32>,
pub label_guides: bool,
pub hole: f32,
pub concentric: bool,
pub polar_grid: PolarGrid,
pub polar_fill: bool,
pub spokes: bool,
pub rings: usize,
pub lines_only: bool,
pub radius_axis: bool,
pub start_angle: f32,
pub sweep: f32,
pub tracks: bool,
pub center: Option<(String, String)>,
pub rules_apart: bool,
pub bars_apart: bool,
pub grid_dashed: bool,
pub value_ticks: usize,
pub grid_columns: Option<usize>,
pub ends_aligned: bool,
pub references: Vec<Reference>,
pub domain: Option<(f64, f64)>,
}Expand description
The look of a chart. Start from PlotStyle::new and change what differs.
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.kind: ChartKindThe kind of chart.
colors: Vec<Color>Series colors, or slice and ring colors, repeated as needed.
item_colors: Vec<Color>Colors per category, over the colors of the series.
ink: ColorText that matters, such as the number in the center.
muted: ColorText around the data.
grid: ColorGridlines.
surface: ColorWhat is behind the chart. Slices are kept apart by a real gap, so it no longer paints anything.
track: ColorThe track behind a ring.
size: f32The font size of the text around the data.
curve: CurveHow lines go from point to point.
stack: StackHow series share a category.
gradient: boolFills areas from strong at the top to faint at the bottom, and bars from strong at the tip to fainter at the base.
fill_opacity: f32How solid an area or a radar polygon is.
horizontal: boolBars lie down, with their categories on the left.
reversed: boolThe value axis runs the other way: bars hang from the top, or if they lie down they grow to the left from the right.
min_bar: f32The shortest a bar with a value gets, however small the value is.
labels_at_zero: boolThe categories of bars sit on the line of zero, on its other side from the bar, instead of along the edge of the chart.
bar_radius: f32The corners of a bar.
max_bar: f32The widest a bar gets.
negative: Option<Color>The color of a bar below zero.
rising: ColorThe color of a candle that closed at or above where it opened.
falling: ColorThe color of a candle that closed below where it opened.
active: Option<usize>The category standing out: a slice comes forward, a bar gets an outline.
dots: boolDraws a dot at each point of a line or a radar.
value_labels: Option<LabelAt>Where the values are written, if at all.
category_labels: Option<LabelAt>Where the categories are written beside the data, if at all.
format: Rc<dyn Fn(f64) -> String>How numbers are written.
tick_format: Rc<dyn Fn(&str) -> String>How categories are written on the axis.
grid_lines: GridGridlines of a chart with axes.
category_axis: boolWrites the categories along the axis.
value_axis: boolWrites numbers along the axis.
tight_scale: boolThe scale fits the values instead of starting from zero.
separator: f32The gap between slices; zero for none.
slice_radii: Vec<f32>How far each slice reaches, in order, as a share of the room from the hole to the edge. One with no number here reaches the edge.
label_guides: boolLabels outside a round chart sit in a column on each side, none over another, each joined to its slice by a line with an elbow.
hole: f32The hole of a doughnut or of rings, as a share of the radius.
concentric: boolOne ring per series, instead of only the first series.
polar_grid: PolarGridThe grid of a radar or radial chart.
polar_fill: boolFills the grid of a radar chart with the first color.
spokes: boolLines from the center of a radar chart to each category.
rings: usizeHow many rings the grid of a radar chart has.
lines_only: boolRadar polygons with no fill.
radius_axis: boolWrites numbers along the radius of a radar chart.
start_angle: f32Where rings start, in degrees clockwise from the top.
sweep: f32How many degrees the largest ring covers.
tracks: boolDraws the track behind each ring.
center: Option<(String, String)>A big number and a caption in the middle of a doughnut or of rings.
rules_apart: boolLeaves gridlines out of Plot::layers and says where they go in
Plot::rules, for a screen that can line them up with its pixels and fade
the data without them. Pages leave this off and get everything in the layers.
bars_apart: boolLeaves bars out of Plot::layers and says where they go in Plot::bars,
for a screen that draws them itself at no cost when the size changes. The
gridlines they cross are left out from behind them, so that a bar that fades
shows no line through it.
grid_dashed: boolGridlines in dashes.
value_ticks: usizeAbout how many steps the value axis has; round numbers decide how many exactly.
grid_columns: Option<usize>Upright gridlines evenly spread into this many columns, instead of at each
category or number, and whatever Self::grid_lines says of the others.
ends_aligned: boolThe first category along the axis starts at its point and the last one ends at its point, so that they line up with the ends of a line or an area.
references: Vec<Reference>Lines across the data at values that matter, such as a target.
domain: Option<(f64, f64)>The value axis goes exactly from the first number to the second, and what is past them is cut off, instead of the axis fitting the values.