How to add multiple lines series dynamically in chart

3 posts, 0 answers
  1. SUSHAMA
    SUSHAMA avatar
    1 posts
    Member since:
    Dec 2012

    Posted 18 Jan 2013 Link to this post

    Hi,
    I am trying to create a chart with multiple line series on it. Data source for the chart is setting dynamically so i can change the series value at run time (live mode) .Chart with single line is working properly in my web application, but i want to add multiple line series and set the values dynamically . Is there any way to do it ? How can i change values of multiple line series ?
  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 18 Jan 2013 Link to this post

    Hi SUSHAMA,

    Generally speaking, Kendo UI Chart does not support dynamic changes neither on its DataSource, nor on its configuration. In order to achieve this you should manually add the new series and data via the chart options and recreate the chart.  For example:
    var chart =  $("#chart").data("kendoChart");
    var chartOptions = chart.options;
     
    //add series
    chartOptions.series.push({});
    //....
     
    //add data to particular series
    chartOptions.series[3].data = [//....]
    //....
     
    //recreate the chart
    chart.redraw();

    Regards,

    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 23 May 2013 Link to this post

    Hello,

    Please use "field" in-place of "data".

    For check below link for whole code.
    http://jayeshgoyani.blogspot.in/2013/05/how-to-add-multiple-lines-series.html

    Thanks,
    Jayesh Goyani
Back to Top