DoughnutOptions
Namespace: Wisej.Web.Ext.ChartJS
Assembly: Wisej.Web.Ext.ChartJS (4.1.0.0)
Options for the Doughnut chart.
- C#
- VB.NET
public class DoughnutOptions : Options
Public Class DoughnutOptions
Inherits Options
The Options property returns an instance of this class when ChartType is Doughnut.
Example:
this.chartJS1.ChartType = ChartType.Doughnut;
var options = (DoughnutOptions)this.chartJS1.Options;
options.CutoutPercentage = 70;
options.Title.Text = "Budget";
Constructors
DoughnutOptions()
Default constructor.
Creates a standalone DoughnutOptions set that is not yet attached to a ChartJS control. Assign it to the Options property of a doughnut chart.
Example:
var options = new DoughnutOptions();
options.CutoutPercentage = 60;
this.chartJS1.ChartType = ChartType.Doughnut;
this.chartJS1.Options = options;
DoughnutOptions(chart, defaults)
Constructs a new instance of the DoughnutOptions set.
| Name | Type | Description |
|---|---|---|
| chart | ChartJS | The ChartJS 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 Title, Legend or Tooltips) are copied into the new instance, which is how the chart preserves the common settings when ChartType changes. The ChartJS control creates this instance automatically when ChartType is Doughnut.
Example:
var options = new DoughnutOptions(this.chartJS1, this.chartJS1.Options);
options.CutoutPercentage = 40;
this.chartJS1.Options = options;
Properties
CutoutPercentage
Int32: Returns or sets the percentage of the chart that is cut out of the middle. (Default: 50)
Value: The percentage of the inner part of the chart that is cut out. The default is 50.
Serialized as the Chart.js cutoutPercentage option. A value of 0 draws a filled pie, higher values make the ring thinner.
Example:
// draw a thin ring.
var options = (DoughnutOptions)this.chartJS1.Options;
options.CutoutPercentage = 85;