“Container is not defined” Google chart

I’m not a jquery fan, but I think that $(‘#pie_today_div’) returns a set of matched elements. The attribute computation works because (from jquery documentation) it “gets the value of an attribute for the first element in the set of matched elements”.

So try

chart = new google.visualization.PieChart($('#pie_today_div')[0]);

or directly

chart = new google.visualization.PieChart(document.getElementById('pie_today_div'));

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)