@using FlexChartAnalytics.Models
@using C1.Web.Mvc.Chart

@model List<MathPoint>

<script src="~/Content/Scripts/movingaverage.js" type="text/javascript"></script>

<div class="copy">
    <h3>FlexChart MovingAverage
    </h3>
    <p>
        This view shows Moving Average in FlexChart.
    </p>
</div>
<div class="container-fluid well">
    <div class="row">
        <div class="col-sm-3 col-xs-12">
            @(Html.C1().Menu().Id("typeMenu").Header("Type: <b>Simple</b>")
            .Command("itemClicked")
                .MenuItems(items => {
                    items.Add("Simple", "Simple");
                    items.Add("Weighted", "Weighted");
                    items.Add("Exponential", "Exponential");
                    items.Add("Triangular", "Triangular");
                }))
        </div>
        <div class="col-sm-5 col-xs-12">
            <label id="labelPeriod" for="inputPeriod">Period:</label>
            @(Html.C1().InputNumber().Id("periodInput").Value(2).Min(2).Max(29).Step(1).Format("n0").OnClientValueChanged("periodChanged"))
        </div>
    </div>
</div>
@(Html.C1().FlexChart().Id("movingAChart").Bind("X", Model)
    .Legend(Position.Right)
    .Series(ses => {
        ses.Add(ChartType.Line, "Base Data").Binding("Y");
        ses.AddMovingAverage("SMA").Binding("Y").Type(MovingAverageType.Simple).Period(2);
    }))
