ChartType
Namespace: Wisej.Web.Ext.ChartJS4
Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)
Specifies the type of chart to display.
- C#
- VB.NET
public enum ChartType
Public Enum ChartType
The value of ChartType is sent to Chart.js as the lower-case enum name (e.g. "line", "bar", "doughnut"). To use a different Chart.js type identifier, including a type registered by a plugin, set Type, which takes precedence.
Chart.js type identifiers are case-sensitive and Chart.js 4 has no horizontalBar type: for polar area charts set Type to "polarArea", and for horizontal bars use Bar with the Chart.js indexAxis option set to "y".
Example:
var chart = new ChartJS4();
chart.ChartType = ChartType.Pie;
chart.Labels = new[] { "Red", "Blue", "Yellow" };
chart.DataSets.Add(new PieDataSet { Data = new object[] { 300, 50, 100 } });
Fields
| Name | Description | Value |
|---|---|---|
| Bar | Bar chart (Chart.js type "bar"). | |
| Bubble | Bubble chart (Chart.js type "bubble"). | |
| Custom | Custom chart type defined by the user. Set Type to the identifier of the custom Chart.js controller (for example one registered by a plugin). | |
| Doughnut | Doughnut chart (Chart.js type "doughnut"). | |
| HorizontalBar | Horizontal bar chart. Rendered as the type "horizontalbar", which is not a built-in Chart.js 4 type; use Bar with the indexAxis option set to "y" instead. | |
| Line | Line chart (Chart.js type "line"). This is the default. | |
| Pie | Pie chart (Chart.js type "pie"). | |
| PolarArea | Polar area chart. The Chart.js type identifier is "polarArea"; since the enum name is sent in lower case, set Type to "polarArea" when using this chart type. | |
| Radar | Radar chart (Chart.js type "radar"). | |
| Scatter | Scatter chart (Chart.js type "scatter"). |
Used By
| Name | Description |
|---|---|
| ChartJS4.ChartType | Returns or sets the ChartType. |