PDA

View Full Version : Column chart and negative numbers



salgaf
7 Mar 2012, 6:44 AM
Hi,
I have problem displaying column chart with negative numbers.

Using this code:


var store = Ext.create('Ext.data.JsonStore', {
fields: ['name', 'data1'],
data: [
{ 'name': 'metric one', 'data1': -10 },
{ 'name': 'metric two', 'data1': -100 },
{ 'name': 'metric three', 'data1': -100 },
{ 'name': 'metric four', 'data1': -100 },
{ 'name': 'metric five', 'data1': -100 }
]
});

Ext.create('Ext.chart.Chart', {
renderTo: Ext.getBody(),
width: 500,
height: 300,
animate: true,
store: store,
axes: [
{
type: 'Numeric',
position: 'left',
fields: ['data1'],
label: {
renderer: Ext.util.Format.numberRenderer('0,0')
},
title: 'Sample Values',
grid: true
},
{
type: 'Category',
position: 'bottom',
fields: ['name'],
title: 'Sample Metrics'
}
],
series: [
{
type: 'column',
axis: 'left',
highlight: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('name') + ': ' + storeItem.get('data1') + ' $');
}
},
label: {
display: 'insideEnd',
'text-anchor': 'middle',
field: 'data1',
renderer: Ext.util.Format.numberRenderer('0'),
orientation: 'vertical',
color: '#333'
},
xField: 'name',
yField: 'data1'
}
]
});



have this result

32464
Searching in the forum I found this:
http://www.sencha.com/forum/showthread.php?147858-Column-charts-cannot-handle-negative-values&p=662805#post662805
but doesn't help.
I also tried with ext-4.1.0 beta 3 but the same.
Anyone know if is still a bug to be solved?
Thanks

mitchellsimoens
7 Mar 2012, 11:44 AM
This has been fixed in the next major working of Charts http://www.sencha.com/forum/showthread.php?147858

RuBenKlunZ
16 Jan 2014, 11:52 PM
This has been fixed in the next major working of Charts http://www.sencha.com/forum/showthread.php?147858

It seems that the fix is for Touch Charts and not ExtJS. When can we expect a fix for that?