Skip to main content

PieOptions

Namespace: Wisej.Web.Ext.ChartJS3

Assembly: Wisej.Web.Ext.ChartJS3 (4.1.0.0)

Options for the Pie chart.

public class PieOptions : 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​

Instance member 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;

Instance member PieOptions(chart, defaults)​

Constructs a new instance of the PieOptions set.

NameTypeDescription
chartChartJS3The ChartJS3 that owns this set of options.
defaultsOptionsDefault 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​

Instance member 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;