PDA

View Full Version : [4.0.2] Y-axis not generated if all values are 0



mailisa
14 Jun 2011, 8:38 AM
Possible bug: When creating a chart (stacked column is what I was using), if all the y values for a particular y have a 0 value, the y-xis is not rendered.

Also noticed this bug in FireBug when using httpproxy and json to load data:
Unexpected value NaN parsing y attribute.
Unexpected value NaN parsing height attribute.

Example:


var dataStore = {
fields: ['Col1', 'Col2', 'time'],
data: [{"Col1": 0, "Col2": 0, "time": "1200"},
{"Col1": 0, "Col2": 0, "time": "1300"},
{"Col1": 0, "Col2": 0, "time": "1400"},
{"Col1": 0, "Col2": 0, "time": "1500"}
]
};

var display = Ext.create('Ext.chart.Chart', {
width: 600,
height: 800,
flex: 1,
animate: true,
shadow: true,
store: dataStore,
legend: {
position: 'bottom'
},

axes: [{
type: 'Numeric',
position: 'left',
fields: ['Col1', 'Col2'],
title: 'Y-axis',
grid: true
}, {
type: 'Category',
position: 'bottom',
fields: ['time'],
grid: true,
title: 'X-axis'
}],

series: [{
type: 'column',
axis: 'left',
gutter: 80,
xField: ['time'],
yField: ['Col1', 'Col2'],
}]
});

var okWindow = Ext.create('Ext.Window', {
title: 'Window',
width: 800,
height: 600,
hidden: false,
maximizable: true,
renderTo: Ext.getBody(),
layout: 'fit',
items: [display]
});

ext-spring-mvc
5 Jul 2011, 12:12 PM
i have similar issue though I can't locate the root cause. got following two warnings in firebug every times reloading the chart's store:


Unexpected value NaN parsing y attribute.
Unexpected value NaN parsing height attribute.

shekhar.kotekar
28 Feb 2012, 11:00 PM
Hi,

I am getting same error while drawing pie chart. I am using extjs 4.0.7 version. Anyone found solution to this problem?

Code for my pie chart is as follows :


xtype: 'chart', title: 'Location wise candidate distribution', itemId: 'CandidateDistributionChart', store: 'CandidateDistribution', width: 250, height: 260, shadow: true, animate: true, theme: 'Base:gradients', legend: { position: 'right' }, series: [{ type: 'pie', field: 'candidateCount', showInLegend: true, label: { field: 'name', contrast: true, font: '18px Arial' } }]

Please help !