Properties and Enums
A number of MVC controls have properties that take enumeration values.
For example, the FlexChart's chartType property takes values of type wijmo.chart.ChartType.
You can set enumeration properties using the enum symbol, numeric value, or name. For example, following three ways are equivalent:
// setting the value of an enumeration property theChart.chartType = wijmo.chart.ChartType.Line; // best: IntelliSense! theChart.chartType = 'Line'; // concise and easy to understand theChart.chartType = 3; // concise but hard to understand
Regardless of the method used, when you make the assignment MVC will convert the values into proper enumeration and store the converted value. If the conversion fails, an exception will be thrown. For example:
// errors theChart.chartType = wijmo.chart.ChartType.MyType; // bad value theChart.chartType = 25; // out of bounds theChart.chartType = 'line'; // wrong case
Live example:
The current chart type is 0 ('Column'). Use the following combobox to switch to other chart type.