PieChart Class
A pie chart: slices whose angles are proportional to their values, labeled with their percentages, and a legend (Mermaid pie). The slices are drawn clockwise from the top, in their order.
public sealed class PieChart : MermaidChartRemarks
As Mermaid, the slices smaller than 1% of the total are not drawn, but the legend lists them.
The chart is drawn with Plot: a pie of the radius of the pies of Mermaid, in the colors of the pie1 to pie12 theme variables of Mermaid, with the legend of Meziantou.Framework.Charts. MermaidChart.ToPlot returns the plot to customize it.
- Inheritance
MermaidChartPieChart
Constructors
| Name | Description |
|---|---|
| PieChart() |
PieChart()
PieChart.cspublic PieChart()No documentation is available.
Properties
| Name | Description |
|---|---|
| DonutHole | Gets or sets the radius of the hole in the middle of the pie, as a ratio of its radius, from 0 for a full pie to 0.9 (Mermaid donutHole). The default is 0. |
| HighlightedSlice | Gets or sets the label of the slice drawn highlighted: bigger and opaque (Mermaid highlightSlice). |
| LegendPosition | Gets or sets the position of the legend. The default is PieLegendPosition.Right. PieLegendPosition.Left and PieLegendPosition.Center are written back, but the legend is drawn on the right: Meziantou.Framework.Charts draws no legend there. |
| LegendTextColor | Gets or sets the color of the texts of the legend, which the title uses too (Mermaid pieLegendTextColor). The default depends on the theme. |
| LegendTextSize | Gets or sets the font size of the texts of the legend (Mermaid pieLegendTextSize). The default is 17. |
| Opacity | Gets or sets the opacity of the slices, from 0 to 1 (Mermaid pieOpacity). The default is 0.7. |
| OuterStrokeColor | Gets or sets the color of the circle around the pie (Mermaid pieOuterStrokeColor). The default is black. |
| OuterStrokeWidth | Gets or sets the width of the circle around the pie (Mermaid pieOuterStrokeWidth). The default is 2. |
| SectionTextColor | Gets or sets the color of the percentages (Mermaid pieSectionTextColor). The default is the text color of the theme. |
| SectionTextSize | Gets or sets the font size of the percentages (Mermaid pieSectionTextSize). The default is 17. |
| ShowData | Gets or sets a value that indicates whether the legend writes the value of each slice after its label (Mermaid showData). |
| SliceColors | Gets the colors of the slices, by position of the slice, which replace the colors of the theme (Mermaid pie1...pie12, for the positions 0 to 11). The colors repeat every 12 slices. |
| Slices | Gets the slices, in the order they are drawn, clockwise from the top. |
| StrokeColor | Gets or sets the color of the borders of the slices (Mermaid pieStrokeColor). The default is black. |
| StrokeWidth | Gets or sets the width of the borders of the slices (Mermaid pieStrokeWidth). The default is 2. |
| TextPosition | Gets or sets the distance of the percentages from the center, from 0 at the center to 1 on the edge of the pie (Mermaid textPosition). The default is 0.75. |
DonutHole
PieChart.csHighlightedSlice
PieChart.csLegendPosition
PieChart.csGets or sets the position of the legend. The default is PieLegendPosition.Right. PieLegendPosition.Left and PieLegendPosition.Center are written back, but the legend is drawn on the right: Meziantou.Framework.Charts draws no legend there.
public PieLegendPosition LegendPosition { get; set; }Property value
LegendTextColor
PieChart.csGets or sets the color of the texts of the legend, which the title uses too (Mermaid pieLegendTextColor). The default depends on the theme.
public SceneColor? LegendTextColor { get; set; }Property value
LegendTextSize
PieChart.csOpacity
PieChart.csOuterStrokeColor
PieChart.csGets or sets the color of the circle around the pie (Mermaid pieOuterStrokeColor). The default is black.
public SceneColor? OuterStrokeColor { get; set; }Property value
OuterStrokeWidth
PieChart.csSectionTextColor
PieChart.csGets or sets the color of the percentages (Mermaid pieSectionTextColor). The default is the text color of the theme.
public SceneColor? SectionTextColor { get; set; }Property value
SectionTextSize
PieChart.csShowData
PieChart.csSliceColors
PieChart.csGets the colors of the slices, by position of the slice, which replace the colors of the theme (Mermaid pie1...pie12, for the positions 0 to 11). The colors repeat every 12 slices.
public IDictionary<int, SceneColor> SliceColors { get; }Property value
Slices
PieChart.csGets the slices, in the order they are drawn, clockwise from the top.
Property value
StrokeColor
PieChart.csGets or sets the color of the borders of the slices (Mermaid pieStrokeColor). The default is black.
public SceneColor? StrokeColor { get; set; }Property value
StrokeWidth
PieChart.csTextPosition
PieChart.csMethods
| Name | Description |
|---|---|
| AddSlice(string, double) | Adds a slice after the last one. |