@model C1MVCFlexChartExport.Models.FlexChartModel

@{
    ViewBag.Title = "ASP.Net MVC FlexChart Export";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="header">
    <div class="container">
        <img src="@Url.Content("~/resources/C1MVCIcon_White.png")" alt="Component One ASP.Net MVC" />        
        <h1>
            C1 ASP.Net MVC FlexChart Export
        </h1>
        <p>
            This page shows how to export C1 ASP.Net MVC FlexChart control to an image.
        </p>
    </div>
</div>

<div class="container">
    <div>

        <input type="text" id="typeMenu" />
        
        <input type="text" id="exportToMenu" />
        

    </div>

    @(Html.C1().FlexChart().Id("FlexChart").Legend(C1.Web.Mvc.Chart.Position.None)
                    .Bind(Model.CountrySalesData).BindingX("Country").Series(sers =>
                    {
                        sers.Add().Binding("Sales").Name("Sales");
                        sers.Add().Binding("Expenses").Name("Expenses");
                        sers.Add().Binding("Downloads").Name("Downloads");
                    })
    )

    <script type="text/javascript">
        c1.documentReady(function () {
            FlexChart = wijmo.Control.getControl("#FlexChart");
        });
    </script>

    @(Html.C1().Menu("#typeMenu").MenuItems(items => 
    {
        for (int i = 0; i < Model.Settings["ChartType"].Length; i++)
        {
            string export = Model.Settings["ChartType"][i] as string;
            items.Add(export, export);
        }
    }).Header("Chart Type: <b>Column</b>").OnClientItemClicked("typeMenu_ItemClicked")
        )

    @(Html.C1().Menu("#exportToMenu").MenuItems(items => 
    {
        for (int i = 0; i < Model.Settings["ExportTo"].Length; i++)
        {
            string export = Model.Settings["ExportTo"][i] as string;
            items.Add(export.ToUpper(), export);
        }
    }).Header("Export To").OnClientItemClicked("exportToMenu_ItemClicked")
        )

    <div style="font-size:0.75em;font-style:italic">
        *This solution is not supported in IE9.
    </div>
</div>
