pub struct PieChartPlot<'a> { /* private fields */ }Expand description
Builder for pie chart plots
Implementations§
Source§impl<'a> PieChartPlot<'a>
impl<'a> PieChartPlot<'a>
Sourcepub fn new(
label_ids: Vec<&'a str>,
values: &'a [f64],
center_x: f64,
center_y: f64,
radius: f64,
) -> Self
pub fn new( label_ids: Vec<&'a str>, values: &'a [f64], center_x: f64, center_y: f64, radius: f64, ) -> Self
Create a new pie chart plot
§Arguments
label_ids- Labels for each slice of the pievalues- Values for each slicecenter_x- X coordinate of the pie center in plot unitscenter_y- Y coordinate of the pie center in plot unitsradius- Radius of the pie in plot units
Sourcepub fn with_label_format(self, fmt: Option<&'a str>) -> Self
pub fn with_label_format(self, fmt: Option<&'a str>) -> Self
Set the label format for slice values (e.g., “%.1f”, “%.0f%%”) Set to None to disable labels
Sourcepub fn with_start_angle(self, angle: f64) -> Self
pub fn with_start_angle(self, angle: f64) -> Self
Set the starting angle in degrees (default: 90.0)
Sourcepub fn with_flags(self, flags: PieChartFlags) -> Self
pub fn with_flags(self, flags: PieChartFlags) -> Self
Set pie chart flags for customization
Sourcepub fn normalize(self) -> Self
pub fn normalize(self) -> Self
Normalize the pie chart values (force full circle even if sum < 1.0)
Ignore hidden slices when drawing (as if they were not there)
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PieChartPlot<'a>
impl<'a> RefUnwindSafe for PieChartPlot<'a>
impl<'a> Send for PieChartPlot<'a>
impl<'a> Sync for PieChartPlot<'a>
impl<'a> Unpin for PieChartPlot<'a>
impl<'a> UnwindSafe for PieChartPlot<'a>
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