PDA

View Full Version : Line Chart Renders null values as zero



Syed Huda
23 Feb 2011, 9:15 AM
file:///C:/DOCUME%7E1/SYED_H%7E1/LOCALS%7E1/Temp/moz-screenshot-2.pngCould someone confirm that "null" values on the x axis would be rendered as zero in a line chart?
I actually have multiple line series to plot, however data is missing for some points on one line.
It drops to zero. But I would like a straight line between available data points. Is this possible in extjs 3.3? or will it be available in extjs 4?

Here's my data store (there are missing data for year1, 2 and 3 for the first line):

var scoreData = [['year1',,0.611,0.00536,0.00936],
['year2',,0.611,0.00536,0.00936],
['year3',,0.611,0.00536,0.00936],
['year4',0.413,0.611,0.00536,0.00936],
['year5',0.813,0.611,0.00536,0.00936]] ;

Here's the graph code:


var graphPanel = new Ext.Panel({
title: 'Score Company PD Graph',
renderTo: 'graphResult',
width:700,
height:300,
layout:'fit',
items: {
xtype: 'linechart',
store: scoreStore,
xField: 'scoreitemYear',
//yField: 'scoreitemValue',
xAxis: new Ext.chart.CategoryAxis({
title: 'Date'
}),
yAxis: new Ext.chart.NumericAxis({
title:'Probability of Default',
majorUnit: .2,
labelRotation: -90
}),
series: [
{
yField: 'scoreitemValue',
displayName: 'Probability of Default',
style: {
color: 0xCCCCCC
}
},
{
yField: 'industryTop',
displayName: 'Industry Top Quartile'
},
,
{
yField: 'industryMed',
displayName: 'Industry Medium Quartile'
},
{
yField: 'industryBot',
displayName: 'Industry Bottom Quartile'
}
],
extraStyle: {
legend: {
display: 'top'
}
}
}
});

Here's image of graph:
24813

And why is the number "2" showing up in the legend??

Please help.

mehulp
24 Feb 2011, 2:16 PM
try the connectDiscontinuousPoints:true setting...



series: [{
...
style: {
...
connectDiscontinuousPoints:true}

}]

designated
9 Jun 2012, 2:33 AM
Did anyone get that solution to work, as I keep getting results that are null displayed as zero. Is this a common problem with the framework?

Thanks

Shaun

designated
16 Jun 2012, 2:01 AM
Bump! Hopefully someone has an answer to this????

designated
23 Jun 2012, 2:29 AM
Bump bump!