ASP.NET MVC Controls | ComponentOne
Client- Side API Reference / FlexChart
In This Topic
    FlexChart
    In This Topic

    All controls in ASP.NET MVC Edition are optimized for client-side web development.

    You can access FlexChart control on client-side with the help of wijmo.Control.getControl() method. Add the script that accesses the control after the control declaration. Use the control's Id to create its jQuery selector and use the client-side API.

    FlexChart has a powerful client API. It internally performs server side operation like local data binding, remote binding, series binding, adding header and footer, and adding data labels. The client side operations include hit test, zooming and panning, and adding plot areas to the charts.

    The following code sample demonstrates how to access a FlexChart control on client-side.

    Client-Side Access
    Copy Code
    @using MVCFlexChart.Models
    @model IEnumerable<FruitSale>
    
    <script>
        var chart;
        c1.mvc.Utils.documentReady(function () {
            chart = wijmo.Control.getControl('#flexChart');       
        });
    </script>
    
    <!--Instantiate FlexChart and set its properties-->
    @(Html.C1().FlexChart().Id("flexChart")
    .Bind("Date", Model)
    .ChartType(C1.Web.Mvc.Chart.ChartType.Column)
    .Series(sers =>
      {
          sers.Add()
         .Binding("SalesInUSA")
         .Name("Sales in USA");
      })
    )
    

    See Wijmo FlexChart API Documentation for more information.