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

@model List<MathPoint>

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

<div class="copy">
        <h3>
            FlexChart TrendLine
        </h3>
        <p>
            This view shows trendline in FlexChart.
        </p>
    </div>
<div class="container-fluid well">
        <div class="row">
            <div class="col-sm-3 col-xs-12">
                <label id="labelShowEquation" for="checkboxShowEquation">Show Equation:</label>
                <input type="checkbox" id="checkboxShowEquation" onchange="showEquation()" checked="checked" />
            </div>
            <div class="col-sm-4 col-xs-12">
                @(Html.C1().Menu().Id("fitTypeMenu").Header("FitType: <b>Linear</b>")
                .Command("itemClicked")
                .MenuItems(items =>
                {
                    items.Add("Linear", "Linear");
                    items.Add("Exponential", "Exponential");
                    items.Add("Logarithmic", "Logarithmic");
                    items.Add("Power", "Power");
                    items.Add("Fourier", "Fourier");
                    items.Add("Polynomial", "Polynomial");
                    items.Add("MinX", "MinX");
                    items.Add("MinY", "MinY");
                    items.Add("MaxX", "MaxX");
                    items.Add("MaxY", "MaxY");
                    items.Add("AverageX", "AverageX");
                    items.Add("AverageY", "AverageY");
                }))
            </div>
            <div id="orderCon" class="col-sm-5 col-xs-12" style="display: none">
                <label id="labelOrder" class="order" for="orderInput">Order:</label>
                @(Html.C1().InputNumber().Id("orderInput").Value(4).Step(1).Format("n0").Min(1).Max(9).OnClientValueChanged("orderChanged"))
            </div>
        </div>
</div>
@(Html.C1().FlexChart().Id("trendChart")
    .Bind("X", Model)
    .AxisY(ay => ay.Min(0).Max(100))
    .Legend(Position.Right)
    .LegendToggle(true)
    .Series(ss =>
    {
        ss.Add(ChartType.Scatter, "Base Data").Binding("Y");
        ss.AddTrendLine("Trend Line").Binding("Y").SampleCount(100).TrendLineOrder(4);
    })
    .AddLineMarker(lm => lm.Id("LineMarker").Lines(LineMarkerLines.None).Interaction(LineMarkerInteraction.None).Content("getContent")))


