Class DonutChart
- Namespace
- Tudormobile.Wpf.Controls
- Assembly
- Tudormobile.WpfControls.dll
Represents a donut chart control that displays data as segments of a ring with an optional center content area.
public class DonutChart : Chart, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient
- Inheritance
-
DonutChart
- Implements
- Inherited Members
Remarks
The donut chart is similar to a pie chart but features a hollow center that can display additional content such as totals, labels, or other contextual information. The chart supports customizable corner radius for rounded segments and data binding through the Series property.
Properties
Content
Gets or sets the content to be displayed in the center of the donut chart.
[Bindable(true)]
public object Content { get; set; }
Property Value
Remarks
The center content area is ideal for displaying summary information, totals, labels, or other contextual data. The content can be any object and will be rendered using the ContentTemplate if specified, or the default string representation.
ContentStringFormat
Gets or sets the format string used to display the center content.
[Bindable(true)]
public string ContentStringFormat { get; set; }
Property Value
Remarks
This property allows you to specify a format string for the content display, such as "{0:N2}" for numeric formatting or "{0:P0}" for percentage formatting. This is applied when ContentTemplate is not specified.
ContentTemplate
Gets or sets the data template used to display the center content.
public DataTemplate ContentTemplate { get; set; }
Property Value
Remarks
The content template defines how the Content object is rendered in the center of the donut chart. If not specified, the content will be displayed using its default string representation or data template.
CornerRadius
Gets or sets the corner radius for the donut chart segments.
public CornerRadius CornerRadius { get; set; }
Property Value
Remarks
Setting a corner radius creates rounded edges on the donut segments. A value of 0 results in sharp edges. Uniform corner radii are typically used for consistent appearance across all segments.
Methods
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnRender(DrawingContext)
When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.
protected override void OnRender(DrawingContext drawingContext)
Parameters
drawingContextDrawingContextThe drawing instructions for a specific element. This context is provided to the layout system.