@model IEnumerable<FlexChartData.Sale>

<h1>
    Properties and Enums
</h1>
<p>
    A number of MVC controls have properties that take enumeration values.
</p>
<p>
    For example, the FlexChart's <b>chartType</b> property takes
    values of type
    <a href="http://helpcentral.componentone.com/nethelp/c1mvchelpers/wijmo.chart.ChartType.Enum.html" target="_blank">wijmo.chart.ChartType</a>.
</p>
<p>
    You can set enumeration properties using the enum symbol,
    numeric value, or name. For example, following three ways are 
    equivalent:
</p>
<pre>// 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
</pre>
<p>
    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:
</p>
<pre>// errors
theChart.chartType = wijmo.chart.ChartType.MyType; // bad value
theChart.chartType = 25; // out of bounds
theChart.chartType = 'line'; // wrong case</pre>

<h4>
    Live example:
</h4>
<p>
    The current chart type is <b><span id="currentType"></span></b>.
    Use the following combobox to switch to other chart type. 
</p>

<div class="demo-settings">
    <label for="chartType">Chart Type: </label>
    @(Html.C1().ComboBox().Id("chartType")
    .Bind(new object[] { "Column", "Bar", "Scatter", "LineSymbols", "Area", "SplineSymbols", 0, 1, 2, 3, 4, 5 })
    )
</div>

@(Html.C1().FlexChart().Id("theChart")
    .Bind("Country", Model)
    .Series(series=> {
        series.Add().Binding("Sales").Name("Sales");
        series.Add().Binding("Expenses").Name("Expenses");
    })
)