pub struct Chart {Show 15 fields
pub title: String,
pub chart_type: ChartType,
pub data: Vec<ChartData>,
pub colors: Vec<Color>,
pub title_font: Font,
pub title_font_size: f64,
pub label_font: Font,
pub label_font_size: f64,
pub legend_position: LegendPosition,
pub background_color: Option<Color>,
pub show_values: bool,
pub show_grid: bool,
pub grid_color: Color,
pub border_color: Color,
pub border_width: f64,
}Expand description
Generic chart configuration
Fields§
§title: StringChart title
chart_type: ChartTypeChart type
data: Vec<ChartData>Chart data
colors: Vec<Color>Chart colors (used if data points don’t have custom colors)
title_font: FontTitle font
title_font_size: f64Title font size
label_font: FontLabel font
label_font_size: f64Label font size
legend_position: LegendPositionLegend position
background_color: Option<Color>Background color
show_values: boolWhether to show values on chart elements
show_grid: boolWhether to show grid lines
grid_color: ColorGrid color
border_color: ColorBorder color
border_width: f64Border width
Implementations§
Source§impl Chart
impl Chart
Sourcepub fn total_value(&self) -> f64
pub fn total_value(&self) -> f64
Get the total value of all data points (useful for pie charts)
Sourcepub fn color_for_index(&self, index: usize) -> Color
pub fn color_for_index(&self, index: usize) -> Color
Get color for a data point at the given index
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chart
impl RefUnwindSafe for Chart
impl Send for Chart
impl Sync for Chart
impl Unpin for Chart
impl UnwindSafe for Chart
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more