PDA

View Full Version : getting error as Error: Invalid value for <rect> attribute y="-Infinity" on chart



bee
3 Dec 2011, 1:32 AM
Hi, I am getting below error when I run my charts.Is this bug ? I am using extjs 4.0.7
Error: Invalid value for <rect> attribute y="-Infinity"
Error: Invalid value for <rect> attribute height="Infinity"
Error: Invalid value for <rect> attribute y="-Infinity"
Error: Invalid value for <rect> attribute height="Infinity"
Error: Invalid value for <rect> attribute y="-Infinity"
Error: Invalid value for <rect> attribute height="Infinity"

mitchellsimoens
5 Dec 2011, 6:39 AM
Can I get a locally runnable code for your charts so I can see what is going wrong? Have seen this when the response isn't what the chart wants.

bee
5 Dec 2011, 7:17 AM
Hi There,
please find my code snippet used for column chart.




var reasonColumnChart = Ext.create('Ext.chart.Chart',{
store : store,
width : 300,
height : 300,
theme : 'Sky',
legend : true,
animate : true,
theme: "Blue",
theme: "Sky",
axes: [
{
title : 'Reason',
type : 'Category',
position: 'bottom',
fields : ['reason_description']

},
{
title: 'Counts',
type: 'Numeric',
position: 'left',
fields: ['count'],
label: {
renderer: Ext.util.Format.numberRenderer('0,1000')
},
grid: true
}

],
// defind the series code for coloum time chart
series: [{
type : 'column',
axis : 'left',
fill : true,
smooth : true,
markerConfig: {
type : 'circle',
radius : 7
},
highlight: true,
xField : 'reason_description',
yField : 'count',
gutter: 150,
groupGutter: 150,
tips : {
trackMouse : true,
renderer : function(storeItem, item){
var tipTitle = " Number : " + storeItem.get('count');
this.setSize(185, 25);
this.setTitle(tipTitle);
}
}
}]
});


This is the way I am creating column chart object.

bee
5 Dec 2011, 7:18 AM
As soon as I loaded my chart, I get this error. The reason could be if store is empty. Will you try by keeping your store empty also ?

mitchellsimoens
5 Dec 2011, 7:34 AM
I actually wait for the store to load before I render the chart due to issues I have seen.

What is your response?

bee
5 Dec 2011, 11:13 PM
I actually wait for the store to load before I render the chart due to issues I have seen.

What is your response?

I am selecting from and to date value from toolbar and click on button to load data , so it throws this error .The other chart throws this error as soon as I open my chart(from menu).
I basically tested this chart on two different databases one, which doesn't have proper data to load data and second ,which has proper data. There also I got error for other chart. So I am not able to understand what is exact problem. Also observed y axis value doesn't appears

Is it some bug for Chart?

toms54
10 Feb 2012, 12:24 PM
Does anyone have an answer to this question. I am getting a similar error. The console just points to line 1 of my index page...

Error: Invalid value for <svg> attribute width="-Infinity"
Error: Invalid value for <svg> attribute height="-Infinity"
Error: Invalid value for <rect> attribute width="-Infinity"
Error: Invalid value for <rect> attribute height="-Infinity"

dipanbhar
30 Apr 2012, 7:57 AM
The issue is the bar's attributes are getting set to negative value, please have the code in bold, i hope this will work.

var reasonColumnChart = Ext.create('Ext.chart.Chart',{ store : store, width : 300, height : 300, theme : 'Sky', legend : true, animate : true, theme: "Blue", theme: "Sky", axes: [ { title : 'Reason', type : 'Category', position: 'bottom', fields : ['reason_description'] }, { title: 'Counts', type: 'Numeric', position: 'left', fields: ['count'], label: { renderer: Ext.util.Format.numberRenderer('0,1000') }, grid: true } ], // defind the series code for coloum time chart series: [{ type : 'column', axis : 'left', fill : true, smooth : true, markerConfig: { type : 'circle', radius : 7 }, highlight: true, xField : 'reason_description', yField : 'count', gutter: 150, groupGutter: 150, renderer: function (sprite, storeItem, barAttr, i, store) {

barAttr.width = (barAttr.width >0 ? barAttr.width : 0);
return barAttr;
},
tips : { trackMouse : true, renderer : function(storeItem, item){ var tipTitle = " Number : " + storeItem.get('count'); this.setSize(185, 25); this.setTitle(tipTitle); } } }]});

itisjoke
27 Aug 2012, 11:37 PM
setting minimum: 0 for vertical axes helps me.



axes: [
{
type: 'Numeric',
position: 'left',
fields: ['value'],
grid: true,
minimum: 0
},
{
type: 'Category',
position: 'bottom',
fields: ['date']
}
],