pub struct ChartBuilder { /* private fields */ }Expand description
Builder for creating charts.
Implementations§
Source§impl ChartBuilder
impl ChartBuilder
Sourcepub fn title_config(self, title: ChartTitle) -> Self
pub fn title_config(self, title: ChartTitle) -> Self
Set the chart title with full configuration.
Sourcepub fn x_axis_config(self, axis: Axis) -> Self
pub fn x_axis_config(self, axis: Axis) -> Self
Configure the primary X axis.
Sourcepub fn y_axis_config(self, axis: Axis) -> Self
pub fn y_axis_config(self, axis: Axis) -> Self
Configure the primary Y axis.
Sourcepub fn secondary_y_axis(self, axis: Axis) -> Self
pub fn secondary_y_axis(self, axis: Axis) -> Self
Add a secondary Y axis (right side).
Sourcepub fn secondary_x_axis(self, axis: Axis) -> Self
pub fn secondary_x_axis(self, axis: Axis) -> Self
Add a secondary X axis (top).
Sourcepub fn secondary_y_range(self, min: f64, max: f64) -> Self
pub fn secondary_y_range(self, min: f64, max: f64) -> Self
Set the secondary Y axis range.
Sourcepub fn add_series<T: Into<DataPoint> + Copy>(
self,
name: impl Into<String>,
data: &[T],
) -> Self
pub fn add_series<T: Into<DataPoint> + Copy>( self, name: impl Into<String>, data: &[T], ) -> Self
Add a data series.
Sourcepub fn add_series_styled<T: Into<DataPoint> + Copy>(
self,
name: impl Into<String>,
data: &[T],
style: SeriesStyle,
) -> Self
pub fn add_series_styled<T: Into<DataPoint> + Copy>( self, name: impl Into<String>, data: &[T], style: SeriesStyle, ) -> Self
Add a data series with custom style.
Sourcepub fn add_series_secondary_y<T: Into<DataPoint> + Copy>(
self,
name: impl Into<String>,
data: &[T],
) -> Self
pub fn add_series_secondary_y<T: Into<DataPoint> + Copy>( self, name: impl Into<String>, data: &[T], ) -> Self
Add a data series on the secondary Y axis.
Sourcepub fn add_series_with_axes<T: Into<DataPoint> + Copy>(
self,
name: impl Into<String>,
data: &[T],
x_axis: AxisId,
y_axis: AxisId,
) -> Self
pub fn add_series_with_axes<T: Into<DataPoint> + Copy>( self, name: impl Into<String>, data: &[T], x_axis: AxisId, y_axis: AxisId, ) -> Self
Add a data series with custom axes.
Sourcepub fn plot_function<F>(
self,
name: impl Into<String>,
f: F,
x_min: f64,
x_max: f64,
samples: usize,
) -> Self
pub fn plot_function<F>( self, name: impl Into<String>, f: F, x_min: f64, x_max: f64, samples: usize, ) -> Self
Plot a mathematical function.
Sourcepub fn add_text_annotation(self, annotation: TextAnnotation) -> Self
pub fn add_text_annotation(self, annotation: TextAnnotation) -> Self
Add a text annotation.
Sourcepub fn add_text_at(self, text: impl Into<String>, x: f64, y: f64) -> Self
pub fn add_text_at(self, text: impl Into<String>, x: f64, y: f64) -> Self
Add a text at data coordinates.
Sourcepub fn add_line_annotation(self, annotation: LineAnnotation) -> Self
pub fn add_line_annotation(self, annotation: LineAnnotation) -> Self
Add a line annotation.
Sourcepub fn add_horizontal_line(self, y: f64, color: Color) -> Self
pub fn add_horizontal_line(self, y: f64, color: Color) -> Self
Add a horizontal reference line.
Sourcepub fn add_vertical_line(self, x: f64, color: Color) -> Self
pub fn add_vertical_line(self, x: f64, color: Color) -> Self
Add a vertical reference line.
Sourcepub fn add_fill_region(self, region: FillRegion) -> Self
pub fn add_fill_region(self, region: FillRegion) -> Self
Add a fill region.
Sourcepub fn add_horizontal_band(self, y_min: f64, y_max: f64, color: Color) -> Self
pub fn add_horizontal_band(self, y_min: f64, y_max: f64, color: Color) -> Self
Add a horizontal band fill.
Sourcepub fn add_vertical_band(self, x_min: f64, x_max: f64, color: Color) -> Self
pub fn add_vertical_band(self, x_min: f64, x_max: f64, color: Color) -> Self
Add a vertical band fill.
Sourcepub fn fill_below_series(
self,
series_index: usize,
baseline: f64,
color: Color,
) -> Self
pub fn fill_below_series( self, series_index: usize, baseline: f64, color: Color, ) -> Self
Add fill below a series.
Sourcepub fn fill_between_series(
self,
series1: usize,
series2: usize,
color: Color,
) -> Self
pub fn fill_between_series( self, series1: usize, series2: usize, color: Color, ) -> Self
Add fill between two series.
Sourcepub fn without_grid(self) -> Self
pub fn without_grid(self) -> Self
Disable grid lines.
Sourcepub fn with_legend(self, position: LegendPosition) -> Self
pub fn with_legend(self, position: LegendPosition) -> Self
Set legend position.
Sourcepub fn without_legend(self) -> Self
pub fn without_legend(self) -> Self
Disable legend.
Sourcepub fn background(self, color: Color) -> Self
pub fn background(self, color: Color) -> Self
Set background color.
Sourcepub fn bar_config(self, config: BarConfig) -> Self
pub fn bar_config(self, config: BarConfig) -> Self
Set bar chart configuration.
Sourcepub fn interactive(self, enabled: bool) -> Self
pub fn interactive(self, enabled: bool) -> Self
Enable interactivity (pan and zoom).
Sourcepub fn with_crosshair(self) -> Self
pub fn with_crosshair(self) -> Self
Enable crosshair on hover.
Sourcepub fn with_tooltips(self) -> Self
pub fn with_tooltips(self) -> Self
Enable tooltips on hover.
Sourcepub fn without_tooltips(self) -> Self
pub fn without_tooltips(self) -> Self
Disable tooltips.
Sourcepub fn zoom_limits(self, min: f32, max: f32) -> Self
pub fn zoom_limits(self, min: f32, max: f32) -> Self
Set zoom limits.
Sourcepub fn add_custom_axis<F>(self, name: &str, f: F) -> Self
pub fn add_custom_axis<F>(self, name: &str, f: F) -> Self
Sourcepub fn add_series_with<F>(self, name: impl Into<String>, f: F) -> Self
pub fn add_series_with<F>(self, name: impl Into<String>, f: F) -> Self
Sourcepub fn streaming_series<F>(
self,
name: impl Into<String>,
capacity: usize,
f: F,
) -> Self
pub fn streaming_series<F>( self, name: impl Into<String>, capacity: usize, f: F, ) -> Self
Trait Implementations§
Source§impl Debug for ChartBuilder
impl Debug for ChartBuilder
Auto Trait Implementations§
impl Freeze for ChartBuilder
impl RefUnwindSafe for ChartBuilder
impl Send for ChartBuilder
impl Sync for ChartBuilder
impl Unpin for ChartBuilder
impl UnsafeUnpin for ChartBuilder
impl UnwindSafe for ChartBuilder
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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