Dynamically adding charts to grid

2 posts, 0 answers
  1. Gwen
    Gwen avatar
    2 posts
    Member since:
    May 2016

    Posted 10 May 2016 Link to this post

    I am working on a part of my application where the user can create a large number of different charts, and i was experimenting with an interface to allow all the charts from a session to persist on the page (the user can scroll back and see all the previous charts and the settings used for them).  I was trying to use the grid control to hold all the charts as they are created, mainly so that unwanted rows could be deleted and the set of charts exported to pdf.  

    The grid starts off empty and I am able to add the first row and create a chart in it.  As i create each row i use the template to add a div with a unique id, and then turn that into a chart.  The problem is that when the second row is added, the first chart disappears.

    The nested chart demo doesn't help because it only shows how to statically create a bunch of the same chart.  in my case the first chart might be a box plot, the second a line chart, the third a bar chart, all with data from different sources.

    Is what I'm wanting to do even possible?

    (btw my dev is in ruby on rails)

  2. Dimiter Madjarov
    Dimiter Madjarov avatar
    2310 posts

    Posted 12 May 2016 Link to this post

    Hello Gwen,

    Yes, adding different chart to each row of the Grid is possible. For example you could execute some custom logic in the dataBound event handler of the Grid - iterate the rows and initialize the specific Chart for each of them. Could you demonstrate the current implementation so we could determine what is causing the disappearing of the first Chart?

    I am looking forward to hearing from you.

    Dimiter Madjarov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top