View Full Version : Dynamic Chart using dynamic grid with dynamic model

25 Jan 2013, 6:51 AM
I have a dynamic grid using the example https://github.com/nonameplum/DynamicGrid.
i want take the grid row and add to chart (column, line.. ).

if select all rows, i need see values in chart like this:

as the date columns are dynamic, which can not be defined before they are added as fields in chart

28 Jan 2013, 12:02 PM
Is this answer for your question?

var onlyDates = [];
for (var key in grid.getStore().getAt(1).data) {
var val = grid.getStore().getAt(1).data[key];
console.log(key + ': ' + val);
//check if key/value is date
if (val instanceof Date) onlyDates.push({ date: key, value: val });

28 Jan 2013, 12:04 PM
I would probably just add/remove chart to the container on top so you can change the series you need. If you don't need to change what series then you can just add/remove records to the store.

28 Jan 2013, 12:10 PM
in this url http://www.sencha.com/forum/showthread.php?242594-Dynamic-grid-with-dynamic-model/page6 I describe the url my code with what I want