pub struct ChartBuilder { /* private fields */ }Expand description
Immediate-mode builder for charts.
Implementations§
Source§impl ChartBuilder
impl ChartBuilder
Sourcepub fn new(width: u32, height: u32, x_style: Style, y_style: Style) -> Self
pub fn new(width: u32, height: u32, x_style: Style, y_style: Style) -> Self
Create a chart builder with widget dimensions.
Sourcepub fn xtick_labels(&mut self, values: &[f64], labels: &[&str]) -> &mut Self
pub fn xtick_labels(&mut self, values: &[f64], labels: &[&str]) -> &mut Self
Set manual x-axis ticks and labels.
Sourcepub fn ytick_labels(&mut self, values: &[f64], labels: &[&str]) -> &mut Self
pub fn ytick_labels(&mut self, values: &[f64], labels: &[&str]) -> &mut Self
Set manual y-axis ticks and labels.
Sourcepub fn title_style(&mut self, style: Style) -> &mut Self
pub fn title_style(&mut self, style: Style) -> &mut Self
Set chart title style.
Sourcepub fn grid_style(&mut self, style: Style) -> &mut Self
pub fn grid_style(&mut self, style: Style) -> &mut Self
Set grid line style.
Sourcepub fn x_axis_style(&mut self, style: Style) -> &mut Self
pub fn x_axis_style(&mut self, style: Style) -> &mut Self
Set x-axis style.
Sourcepub fn y_axis_style(&mut self, style: Style) -> &mut Self
pub fn y_axis_style(&mut self, style: Style) -> &mut Self
Set y-axis style.
Sourcepub fn x_axis_visible(&mut self, on: bool) -> &mut Self
pub fn x_axis_visible(&mut self, on: bool) -> &mut Self
Enable or disable x-axis line/labels/title rows.
Sourcepub fn y_axis_visible(&mut self, on: bool) -> &mut Self
pub fn y_axis_visible(&mut self, on: bool) -> &mut Self
Enable or disable y-axis labels and divider.
Sourcepub fn legend(&mut self, position: LegendPosition) -> &mut Self
pub fn legend(&mut self, position: LegendPosition) -> &mut Self
Set legend position.
Sourcepub fn line(&mut self, data: &[(f64, f64)]) -> &mut DatasetEntry
pub fn line(&mut self, data: &[(f64, f64)]) -> &mut DatasetEntry
Add a line dataset.
Sourcepub fn area(&mut self, data: &[(f64, f64)]) -> &mut DatasetEntry
pub fn area(&mut self, data: &[(f64, f64)]) -> &mut DatasetEntry
Add an area dataset.
Sourcepub fn scatter(&mut self, data: &[(f64, f64)]) -> &mut DatasetEntry
pub fn scatter(&mut self, data: &[(f64, f64)]) -> &mut DatasetEntry
Add a scatter dataset.
Sourcepub fn bar(&mut self, data: &[(f64, f64)]) -> &mut DatasetEntry
pub fn bar(&mut self, data: &[(f64, f64)]) -> &mut DatasetEntry
Add a bar dataset.
Sourcepub fn build(self) -> ChartConfig
pub fn build(self) -> ChartConfig
Build the final chart config.
Trait Implementations§
Source§impl Clone for ChartBuilder
impl Clone for ChartBuilder
Source§fn clone(&self) -> ChartBuilder
fn clone(&self) -> ChartBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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
Mutably borrows from an owned value. Read more