PDA

View Full Version : Line Chart not taking repeating points



mishramohar
7 Apr 2010, 1:03 AM
I have a line chart and to code looks like this.

Ext.onReady(function(){
var store = new Ext.data.JsonStore({
idProperty: 'val',
fields: ['area', 'yield'],
data: [
{area:10, yield: 10},
{area:20, yield: 50},
{area:30, yield: 30},
{area:30, yield: 20}
]
});

new Ext.Panel({
width: 600,
height: 400,
renderTo: 'container',
title: 'area vs yield',
items:
{
xtype: 'linechart',
store: store,
xField: 'area',
xAxis: new Ext.chart.NumericAxis
({
stackingEnabled: true,
labelRenderer : Ext.util.Format.numberRenderer('0,0')

}),
yAxis: new Ext.chart.NumericAxis
({
stackingEnabled: true,
labelRenderer : Ext.util.Format.numberRenderer('0,0')

}),

series: [
{
yField: 'yield',

displayName: 'Yield',
style:{connectPoints: true}
}
]
}
});
});

If you notice in the data I am feeding to the chart I have kept the same value for the column 'area' in the last two records(marked them in red). When I repeat the data points particularly for the xField I see the chart component taking only the last data point and it is ignoring the previous data points.

Can anyone help me on this. I don't think this is an expected behavior.

Thanks
Mohar

evant
7 Apr 2010, 1:07 AM
How else would you have it behave?

mishramohar
7 Apr 2010, 1:12 AM
I am expecting two points to show one on top of the other for the xField val 30.