chart display based on dropdown selected item

2 posts, 0 answers
  1. Rajendra
    Rajendra avatar
    1 posts
    Member since:
    Nov 2014

    Posted 11 Nov 2014 Link to this post

    Based on the selection of dropdownlist item, I would need to query the database with the selected item and display the results as chart.
    Could anyone please point me to the example url
  2. T. Tsonev
    T. Tsonev avatar
    2760 posts

    Posted 13 Nov 2014 Link to this post


    You should first take a look at the Binding to remote data demo.

    A simple way to do change the query is to trigger a read on the data source of the chart:
        .DataSource(ds => ds.Read(read => read.Action("Read", "Home")))
        .Series(series => {
            series.Column(model => model.Value).Name("Series 1");
        .CategoryAxis(axis => axis
            .Categories(model => model.Year)

    <button id="filter">Filter</button>
        $("#filter").click(function () {
            var chart = $("#chart").getKendoChart();
                myData: "foo"

    Here we're hitting the controller with additional data that can contain for example our filter criteria.
    It's accessible as regular parameters on the action:
    public ActionResult _SpainElectricityProduction(string myData)
          return Json(...);

    The chart will be updated with the new data as returned from the action.
    Notice that we can't change series definitions or chart options directly.
    Such updates concerns only the data source and the series data.

    I hope this helps.

    T. Tsonev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. UI for ASP.NET AJAX banner
Back to Top