PieOptions
Namespace: Wisej.Web.Ext.ChartJS3
Assembly: Wisej.Web.Ext.ChartJS3 (4.1.0.0)
Options for the Pie chart.
- C#
- VB.NET
public class PieOptions : Options
Public Class PieOptions
Inherits Options
The Options property returns an instance of this class when ChartType is Pie.
Example:
this.chartJS31.ChartType = ChartType.Pie;
var options = (PieOptions)this.chartJS31.Options;
options.Plugins.Legend.Position = HeaderPosition.Left;
options.Plugins.Title.Text = "Market Share";
Constructors
PieOptions()
Default constructor.
Creates a standalone PieOptions set that is not yet attached to a ChartJS3 control. Assign it to the Options property of a pie chart.
Example:
var options = new PieOptions();
options.Plugins.Legend.Display = false;
this.chartJS31.ChartType = ChartType.Pie;
this.chartJS31.Options = options;
PieOptions(chart, defaults)
Constructs a new instance of the PieOptions set.
| Name | Type | Description |
|---|---|---|
| chart | ChartJS3 | The ChartJS3 that owns this set of options. |
| defaults | Options | Default options to copy from. Can be null. |
When defaults is not null, the properties shared with it (for example Plugins, Scales or IndexAxis) are copied into the new instance, which is how the chart preserves the common settings when ChartType changes. Nested option sets are copied into new instances, other properties are copied only when they have a non-default value. The ChartJS3 control creates this instance automatically when ChartType is Pie.
Example:
var options = new PieOptions(this.chartJS31, this.chartJS31.Options);
options.Plugins.Tooltip.Enabled = false;
this.chartJS31.Options = options;
Properties
Cutout
Int32: Returns or sets the size of the inner part of the chart that is cut out. (Default: 0)
Value: The size of the cut out area. The default is 0.
Serialized as the Chart.js 3 cutout option. Chart.js 3 interprets a numeric cutout as a size in pixels (a percentage requires a string such as "50%", which this property can't express), so the value is the radius in pixels of the hole in the middle of the chart. A value of 0 draws a filled pie. Changing the value calls Update.
Example:
// turn the pie into a ring.
var options = (PieOptions)this.chartJS31.Options;
options.Cutout = 60;