@using LearnMvcClient.Models

@{ 
    IEnumerable<FlexChartData.Point> points1 = ViewBag.Points1;
    IEnumerable<FlexChartData.Point> points2 = ViewBag.Points2;
    IEnumerable<FlexChartData.Point> points3 = ViewBag.Points3;
}

<h1>
    FlexChart Export
</h1>
<p>
    Saving charts as images for inclusion in other documents
    is a common requirement. Some browsers support this as
    a context menu option, but not all.
</p>
<p>
    The FlexChart's <b>saveImageToFile</b> method makes this
    really easy:
</p>

<p id="saveButtons">
    Save as:
    <button class="btn btn-default">PNG</button>
    <button class="btn btn-default">JPEG</button>
    <button class="btn btn-default">SVG</button>
</p>

@(Html.C1().FlexChart().Id("theChart")
    .ChartType(C1.Web.Mvc.Chart.ChartType.Scatter)
    .Header("Phase II Test Result")
    .AxisY(ab=>ab.AxisLine(true))
    .Series(sb=>
    {
        sb.Add().Bind("X", "Y", points1).Name("Experiment 1");
        sb.Add().Bind("X", "Y", points2).Name("Experiment 2");
        sb.Add().Bind("X", "Y", points3).Name("Experiment 3");
    })
)