PDA

View Full Version : Is there a bug in Ext-JS 4.07 charts?



chrwjr
24 Feb 2012, 10:53 PM
OK, 40+ hours trying to get some decent executive dashboards on my portal and I am getting no where.

Here is what is showing:

32130

And note that the numbers on the bars are the number of loans processed by a particular client each month. Why is the X-axis not aligning with this? The max value is correct but everything else is not. For example take 2012-08 (August). The number of loans processed was 17, yet that bar sits between 12 nd 14 on the x-axis.

Here is a dump of the data: (You can ignore "application_amount") it is merely a player in mouse-over animation.

[{"application_date":"2012-02","application_number":"13","application_amount":"$1,542,852"},{"application_date":"2012-01","application_number":"15","application_amount":"$1,441,745"},{"application_date":"2011-12","application_number":"12","application_amount":"$1,809,250"},{"application_date":"2011-11","application_number":"16","application_amount":"$5,478,000"},{"application_date":"2011-10","application_number":"14","application_amount":"$1,650,050"},{"application_date":"2011-09","application_number":"14","application_amount":"$1,943,780"},{"application_date":"2011-08","application_number":"17","application_amount":"$1,672,000"},{"application_date":"2011-07","application_number":"12","application_amount":"$905,000"},{"application_date":"2011-06","application_number":"21","application_amount":"$2,242,790"},{"application_date":"2011-05","application_number":"17","application_amount":"$2,214,800"},{"application_date":"2011-04","application_number":"19","application_amount":"$2,006,500"},{"application_date":"2011-03","application_number":"13","application_amount":"$1,810,500"},{"application_date":"2011-02","application_number":"10","application_amount":"$1,948,000"}]

And here is the code:


xtype: 'chart',
border: 1,
height: 250,
id: 'chart_loan_volume',
itemId: 'chart_loan_volume',
width: 400,
stateful: false,
focusOnToFront: false,
toFrontOnShow: false,
animate: true
,
insetPadding: 20,
store: 'VolumeStatsStore',
theme: 'Category1',
axes: [
{
type: 'Category',
fields: [
'application_date'
],
position: 'left',
title: 'Month'
},
{
type: 'Numeric',
fields: [
'application_number'
],
grid: true,
label: {
labelRenderer: Ext.util.Format.numberRenderer('0,0')
},
majorTickSteps: 10,
minorTickSteps: 5,
position: 'bottom',
title: 'Number of Loans',
decimals: 0,
minimum: 0
}
],
series: [
{
type: 'bar',
label: {
display: 'insideEnd',
field: 'application_number',
color: '#333',
'text-anchor': 'middle'
},
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function(storeItem,
item){
this.setTitle(storeItem.get('application_date') + ': ' + storeItem.get('application_amount'));
}
},
xField: 'application_date',
yField: [
'application_number'
]
}
]
}
]
},

mitchellsimoens
25 Feb 2012, 8:05 AM
There are some bugs. If you remove the minmum config does it look right?

chrwjr
25 Feb 2012, 9:03 AM
That will do. I like to start my x-axis at zero, but I prefer accuracy and removing "minimum: 0" does achieve that. Thanks!