Chart not displayed on one page

22 views
Skip to first unread message

aandreos

unread,
Mar 1, 2017, 11:38:36 AM3/1/17
to Google Visualization API
Hello everybody,

I've already added several Google charts on a website and all of them are working well. I wanted to add another one by making a copy/paste of the javascript and html codes. I've made the changes of the data to do so. But the chart doesn't show on the webpage. I've checked the data and code but I didn't see what went wrong.

Here is my function for drawing the chart:

google.setOnLoadCallback(drawMarkersMap41);
function drawMarkersMap41() {
var imbamapdatafr = google.visualization.arrayToDataTable([
['Region', '%', '% of students from this area'],
['North America', 'North America 8%' , 8],
['South America', 'South America 16%' , 16],
['Europe', 'Europe 20%', 20],
['East Asia', 'East Asia 16%',  16],
['South Asia', 'South Asia 32%', 32],
['South East Asia', 'South East Asia 4%', 4],
['Africa', 'Africa 4%', 4]
]);
var options = {
displayMode: 'text',
magnifyingGlass: {enable: true, zoomFactor: 10.5},
sizeAxis: {minValue: 2,  maxSize: 18, minSize: 12},
colorAxis: {colors:['#018990','#018990']},
datalessRegionColor: '#FFEEBC',
legend: {textStyle: {color: 'black', fontName: 'foundrysterling-boldregular'}},
fontSize: 14,
fontName: 'foundrysterling-boldregular',
tooltip: {textStyle: {color: '#636466'}, showColorCode: true, text: 'percentage'},
backgroundColor: 'none'
};
var chartimbamapfr = new google.visualization.GeoChart(document.getElementById('imba_chart_div_fr'));
chartimbamapfr.draw(imbamapdatafr, options);
}

And here is my html line holding the chart:
<div id="imba_chart_div_fr" style="width:100%; height:400px"></div>

What did I miss? 
Thank you very much for your help.

Best regards, 
Anaïs

Daniel LaLiberte

unread,
Mar 1, 2017, 11:45:46 AM3/1/17
to Google Visualization API
I would recommend switching to the new loader.  See the docs for GeoChart:  https://developers.google.com/chart/interactive/docs/gallery/geochart


Most important of all, don't load different loaders in the same page in an attempt to mix charts from different versions.  And don't load the loader more than once.

Hope that helps.


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/c9b50881-c494-4ff3-8184-c592f7131343%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages