PDA

View Full Version : line graph in grid cell



nadim59
16 Dec 2011, 5:59 AM
I have a grid with 12 values (1 per month).
I would like to add a column with a graph displaying on each row the content of the previous values. Is it possible?
Actually, i have a single graph that i refresh on selectionchange but the effect is not as a real dashboard.
I'm working with extjs 4.0.7.

mitchellsimoens
16 Dec 2011, 8:12 AM
It's possible but good luck with performance. You can render the chart to any element using renderTo

nadim59
16 Dec 2011, 9:09 AM
Thank you for your answer.
The grid have a paging toolbar and i can reduce number of rows so performance should not be a problem.
As i'm working with a json filled with cgi script. I cannot find the way to dinamically generate the store for the graph using local data (the one already available in the grid row) from inside the renderer.

skirtle
16 Dec 2011, 9:21 AM
Inside the renderer you have full access to the record for that row. It's the third argument passed to the renderer. Doesn't that give you the information you need to create the chart's store?

http://localhost/temp-ext-4.0.7/docs/index.html#!/api/Ext.grid.column.Column-cfg-renderer

You may find this UX makes life a bit easier:

http://www.sencha.com/forum/showthread.php?148064