PDA

View Full Version : multiline charts



raip
12 Apr 2010, 2:24 PM
I have a datastore in the following format and I need to plot rep on Y axis, month on X and lines on amount.

rep month amt
====== ======== ====
Scott JAN 2010 1000.00
Amy JAN 2010 1999.00
Rachel JAN 2010 29102.00
Roxi JAN 2010 8479.00
Michael JAN 2010 13894.00
Scott FEB 2010 1000.00
Amy FEB 2010 1999.00
Rachel FEB 2010 29102.00
Roxi FEB 2010 8479.00
Michael FEB 2010 13894.00

I have my items defined as below,

items:
{
xtype: 'linechart',
store: mystore,
height:205,
xField: 'month', extraStyle:{xAxis:{labelRotation: -45},legend:{display:'bottom' }},
yField: 'rep',
yAxes: axes,
series:
[
{
type: 'line',
axis: 'primary',
yField: amt,
displayName: 'Total Sales'
}

]
....

It draws only one line and calculate god know what. Does anybody know the trick how to put one line per rep?

I appreciate any suggestions.

Thanks,
Prakash

raip
14 Apr 2010, 2:11 PM
I have accomplished this by transposing REP into columns. But then I hit the challenge when rep come and go. My attempt to handle that is to build the series dynamically. Is that viable? Any suggestions?