I don't know if this resolved itself back in 2013, but this is the exact 
scenario I am in: it was working yesterday, and without any code changes, 
it has stopped working.

I won't post the whole code as it is commercially sensitive, but here is 
the important subset:


(function ($) {
 $(document).ready(function () {


$.ajax(

......



success: function (data) {
            if(data.Charts){i=0;
            for( key in data.Charts){
            chart(i,data.Charts[key]);
            i++;}
            }
});

....




function chart(number,data){
            var dataTable = new google.visualization.DataTable();
            dataTable.addColumn('string',charts[number].name);
            dataTable.addColumn('number', 'Quantity');
            dataTable.addRows(data.length);
            var val=$('#i'+charts[number].id).attr('value');
            var select=false;
            for(key in data){
                for(index in data[key]){
                    if(index!='total' && val && val==data[key][index])select
=parseInt(key,10);
                 dataTable.setValue(parseInt(key,10),(index=='total')?1:0, 
data[key][index]);
                }


            }


            var options = {
              'title': charts[number].name,
              height:300,
              width:500,
              legend: {
                  position: 'right',
                  textStyle:{color: '#444444', fontName: 'Open Sans', 
fontSize: '13'}
        },titleTextStyle:{color: '#444444', fontName: 'Open Sans', fontSize: 
'20'},
        chartArea:{left:20,top:40,width:410,height:240}
            };
            var chart = new google.visualization.ChartWrapper({
                chartType: 'PieChart',
                dataTable: dataTable,
                options: options,
            containerId: 'c'+charts[number].id});


            google.visualization.events.addListener(chart, 'select', 
selectHandler);


            chart.draw(dataTable);


function selectHandler() {
                var val='';
                if(chart.getChart().getSelection()[0]){
                 var row=chart.getChart().getSelection()[0].row
                 val=chart.getDataTable().getValue(row,0);
                }
                $('#i'+charts[number].id).attr('value',val);
}
}


});
    google.load("visualization", "1", {packages:["corechart"]});




})(jQuery);

And yes, <div id="c1"></div> is in the page. If I put a breakpoint on 
chart.draw, chart.getContainer() is set to div#c1.

Many thanks.



On Sunday, 24 February 2013 21:51:40 UTC, Andrea Maestroni wrote:
>
> hi to all!
>
> i have a problem with the visualization of a piechart.
> My program run until the 22 february, after this date (the problem begin 
> the 23 february) I have not modified the code but there are some problem 
> with the chart..i say to me:
> Uncaught Error: Container is not defined 
> format+it,default,corechart.I.js:342 
> <https://www.google.com/uds/api/visualization/1.0/cbcd5e2904628a4ef4d665354dc31eeb/format+it,default,corechart.I.js>
>
> I created the div automatically and is present when i "draw" the 
> piechart...but the strange thing is that this error before I did not dave 
> and now despite not having changed the code from one day to another ...
>
> someone know why?
>
> thanks a lot!
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-chart-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to