pub struct PieChartBuilder<C: PixelColor> { /* private fields */ }Expand description
Builder for pie charts
Implementations§
Source§impl<C> PieChartBuilder<C>
impl<C> PieChartBuilder<C>
Sourcepub fn start_angle(self, angle: f32) -> Self
pub fn start_angle(self, angle: f32) -> Self
Set the starting angle
Sourcepub fn donut(self, inner_radius: u32) -> Self
pub fn donut(self, inner_radius: u32) -> Self
Make this a donut chart with the specified inner radius
Sourcepub fn donut_percentage(self, percentage: u32) -> Self
pub fn donut_percentage(self, percentage: u32) -> Self
Make this a donut chart with inner radius as percentage of outer radius
§Arguments
percentage- Inner radius as percentage (0-100) of the outer radius
§Examples
// Create a balanced donut chart (40% inner radius)
let chart = PieChart::builder()
.radius(100)
.donut_percentage(40) // Inner radius will be 40 pixels
.colors(&[Rgb565::BLUE, Rgb565::RED])
.build()?;Sourcepub fn balanced_donut(self) -> Self
pub fn balanced_donut(self) -> Self
Make this a balanced donut chart with 50% inner radius
This is a convenience method for creating visually balanced donut charts that work well across different display sizes.
§Examples
let chart = PieChart::builder()
.radius(80)
.balanced_donut() // Inner radius will be 40 pixels (50%)
.colors(&[Rgb565::BLUE, Rgb565::RED])
.build()?;Sourcepub fn thin_donut(self) -> Self
pub fn thin_donut(self) -> Self
Make this a thin donut chart with 25% inner radius
Thin donuts emphasize the data segments while still providing some center space. Good for detailed data analysis.
Sourcepub fn thick_donut(self) -> Self
pub fn thick_donut(self) -> Self
Make this a thick donut chart with 75% inner radius
Thick donuts maximize center space for displaying additional information like totals or status indicators.
Sourcepub fn with_border(self, border: BorderStyle<C>) -> Self
pub fn with_border(self, border: BorderStyle<C>) -> Self
Add a border to slices
Sourcepub fn labels(self, labels: LabelStyle) -> Self
pub fn labels(self, labels: LabelStyle) -> Self
Configure labels
Sourcepub fn with_title(self, title: &str) -> Self
pub fn with_title(self, title: &str) -> Self
Set the chart title
Sourcepub fn background_color(self, color: C) -> Self
pub fn background_color(self, color: C) -> Self
Set the background color
Trait Implementations§
Source§impl<C> ChartBuilder<C> for PieChartBuilder<C>
impl<C> ChartBuilder<C> for PieChartBuilder<C>
Source§impl<C: Debug + PixelColor> Debug for PieChartBuilder<C>
impl<C: Debug + PixelColor> Debug for PieChartBuilder<C>
Auto Trait Implementations§
impl<C> Freeze for PieChartBuilder<C>where
C: Freeze,
impl<C> RefUnwindSafe for PieChartBuilder<C>where
C: RefUnwindSafe,
impl<C> Send for PieChartBuilder<C>where
C: Send,
impl<C> Sync for PieChartBuilder<C>where
C: Sync,
impl<C> Unpin for PieChartBuilder<C>where
C: Unpin,
impl<C> UnwindSafe for PieChartBuilder<C>where
C: UnwindSafe,
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.