PDA

View Full Version : Multiple dynamic lines in chart



Datawarehouse MCH
14 May 2014, 5:08 AM
Hi all,

I want to create a linechart with a dynamical number of lines. Is there an example online? Any good practices?

The general idea is:

grid.onrow(s)select => getdata => add to chart

In somewhat more detail:




(grid multiselect)

chart.series.remove();

store.load({
params: { (multiselect)
},
callback: function(xxxxx) {
each(row) {
var serie = {
type: 'line',
data = data
};
chart.add(serie);
}
}
}

chart.redraw();



Is this a sensible way to solve this?
Any comments or suggestions appreciated.

--
Fabio

scottmartin
14 May 2014, 8:20 AM
Do you have a visual to review?

You can draw manual lines like shown here:
https://fiddle.sencha.com/#fiddle/15d

Or you can add series, or split a line:
http://jsfiddle.net/tqdJ8/

Datawarehouse MCH
15 May 2014, 11:42 PM
Do you have a visual to review?

No visual, still starting up. It's supose to be like this chart:

http://docs.sencha.com/extjs/4.2.2/#!/example/charts/Line.html

The lines in the chart are supposed to be generated from a selection in a separate grid(no hide/unhide like with the legend).
There could be any number of lines in this chart(however we planning on building in a max of 4,5).

Regards,
Fabio