Skip to main content

ChartType

Namespace: Wisej.Web.Ext.ChartJS4

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

Specifies the type of chart to display.

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​

NameDescriptionValue
BarBar chart (Chart.js type "bar").
BubbleBubble chart (Chart.js type "bubble").
CustomCustom chart type defined by the user. Set Type to the identifier of the custom Chart.js controller (for example one registered by a plugin).
DoughnutDoughnut chart (Chart.js type "doughnut").
HorizontalBarHorizontal 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.
LineLine chart (Chart.js type "line"). This is the default.
PiePie chart (Chart.js type "pie").
PolarAreaPolar 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.
RadarRadar chart (Chart.js type "radar").
ScatterScatter chart (Chart.js type "scatter").

Used By​

NameDescription
ChartJS4.ChartTypeReturns or sets the ChartType.