dhtmlx.chart.pie._getRatios: data not defined

Hello,

I’m new to DHTMLX and to javascript. I’m trying to do something simple.
But I get this error at page loading:

“ReferenceError: data is not defined” in dhtmlxchart.js line 2682:

for(var i = 0; i < data.length;i++){

which is part of this function in dhtmlxchart.js:

_getRatios:function(values,totalValue){ var value; var ratios = []; var prevSum = 0; totalValue = totalValue||this._getTotalValue(values); for(var i = 0; i < data.length;i++){ value = values[i]; ratios[i] = Math.PI*2*(totalValue?((value+prevSum)/totalValue):(1/data.length)); prevSum += value; } return ratios; },

I debugged the code in Firefox with Firebug and although the values that need to be rendered are there; “data” is null. I don’t know why.

Here is my code (it is in my page body):

[code]

[/code]

Can you help please ?
Thank you.

Hello,

we have not reproduced the problem locally. There is not data occurrence in _getRatios method. Please download the latest Suite or Chart package

OK thank you.
I updated my libs and now I’ve got the pie chart almost working.
Except that now, for all my charts, the canvas is offset to the right. Like in the following image.
This didn’t happen before. I commented my CSS to see if it changed something, but it didn’t.



Please download the libs attached to the following post:

viewtopic.php?f=8&t=32583&p=102201#p102201