pub struct PieChart<T: 'static> { /* private fields */ }Implementations§
Source§impl<T> PieChart<T>
impl<T> PieChart<T>
pub fn new<I>(data: I) -> Selfwhere
I: IntoIterator<Item = T>,
Sourcepub fn inner_radius(self, inner_radius: f32) -> Self
pub fn inner_radius(self, inner_radius: f32) -> Self
Set the inner radius of the pie chart.
Sourcepub fn inner_radius_fn(
self,
inner_radius_fn: impl Fn(&ArcData<'_, T>) -> f32 + 'static,
) -> Self
pub fn inner_radius_fn( self, inner_radius_fn: impl Fn(&ArcData<'_, T>) -> f32 + 'static, ) -> Self
Set the inner radius of the pie chart based on the arc data.
Sourcepub fn outer_radius(self, outer_radius: f32) -> Self
pub fn outer_radius(self, outer_radius: f32) -> Self
Set the outer radius of the pie chart.
Sourcepub fn outer_radius_fn(
self,
outer_radius_fn: impl Fn(&ArcData<'_, T>) -> f32 + 'static,
) -> Self
pub fn outer_radius_fn( self, outer_radius_fn: impl Fn(&ArcData<'_, T>) -> f32 + 'static, ) -> Self
Set the outer radius of the pie chart based on the arc data.
pub fn value(self, value: impl Fn(&T) -> f32 + 'static) -> Self
Trait Implementations§
Source§impl<T: 'static> Element for PieChart<T>
实现 Element trait,提供图表的布局和渲染逻辑
impl<T: 'static> Element for PieChart<T>
实现 Element trait,提供图表的布局和渲染逻辑
Source§fn source_location(&self) -> Option<&'static Location<'static>>
fn source_location(&self) -> Option<&'static Location<'static>>
返回源代码位置信息(图表元素不需要)
Source§fn request_layout(
&mut self,
_: Option<&GlobalElementId>,
_: Option<&InspectorElementId>,
window: &mut Window,
cx: &mut App,
) -> (LayoutId, Self::RequestLayoutState)
fn request_layout( &mut self, _: Option<&GlobalElementId>, _: Option<&InspectorElementId>, window: &mut Window, cx: &mut App, ) -> (LayoutId, Self::RequestLayoutState)
请求布局,使用全尺寸样式
Source§fn prepaint(
&mut self,
_: Option<&GlobalElementId>,
_: Option<&InspectorElementId>,
_: Bounds<Pixels>,
_: &mut Self::RequestLayoutState,
_: &mut Window,
_: &mut App,
) -> Self::PrepaintState
fn prepaint( &mut self, _: Option<&GlobalElementId>, _: Option<&InspectorElementId>, _: Bounds<Pixels>, _: &mut Self::RequestLayoutState, _: &mut Window, _: &mut App, ) -> Self::PrepaintState
预绘制阶段(图表不需要额外处理)
Source§fn paint(
&mut self,
_: Option<&GlobalElementId>,
_: Option<&InspectorElementId>,
bounds: Bounds<Pixels>,
_: &mut Self::RequestLayoutState,
_: &mut Self::PrepaintState,
window: &mut Window,
cx: &mut App,
)
fn paint( &mut self, _: Option<&GlobalElementId>, _: Option<&InspectorElementId>, bounds: Bounds<Pixels>, _: &mut Self::RequestLayoutState, _: &mut Self::PrepaintState, window: &mut Window, cx: &mut App, )
绘制阶段,委托给 Plot::paint 进行实际渲染
Source§type RequestLayoutState = ()
type RequestLayoutState = ()
Source§type PrepaintState = ()
type PrepaintState = ()
Element::prepaint 返回的状态类型。
此状态的可变引用会在后续的 Element::paint 中传递。Source§fn write_a11y_info(&self, _node: &mut Node)
fn write_a11y_info(&self, _node: &mut Node)
Write accessibility properties to the given node.
Source§fn into_any(self) -> AnyElement
fn into_any(self) -> AnyElement
Convert this element into a dynamically-typed
AnyElement.Source§impl<T: 'static> IntoElement for PieChart<T>
实现 IntoElement trait,使图表类型可直接作为元素使用
impl<T: 'static> IntoElement for PieChart<T>
实现 IntoElement trait,使图表类型可直接作为元素使用
Source§type Element = PieChart<T>
type Element = PieChart<T>
The specific type of element into which the implementing type is converted.
Useful for converting other types into elements automatically, like Strings
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Convert self into a type that implements
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
Convert self into a dynamically-typed
AnyElement.Auto Trait Implementations§
impl<T> !RefUnwindSafe for PieChart<T>
impl<T> !Send for PieChart<T>
impl<T> !Sync for PieChart<T>
impl<T> !UnwindSafe for PieChart<T>
impl<T> Freeze for PieChart<T>
impl<T> Unpin for PieChart<T>where
T: Unpin,
impl<T> UnsafeUnpin for PieChart<T>
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with an animation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Imperatively modify self with the given closure.
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
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