This is a migrated thread and some comments may be shown as answers.

Dynamically adding charts to grid

1 Answer 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gwen
Top achievements
Rank 1
Gwen asked on 10 May 2016, 08:07 PM

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)

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 12 May 2016, 08:24 AM

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.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Gwen
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or