Visualization: Geochart in Android WebView

702 views
Skip to first unread message

Pratik Patel

unread,
Mar 21, 2012, 9:53:58 AM3/21/12
to Google Visualization API, nix...@gmail.com
Hello there,
I want to use this api in Android webview.

I have loaded the sample code given below...

<html>
<head>
<script type='text/javascript' src='https://www.google.com/
jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawRegionsMap);

function drawRegionsMap() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Country');
data.addColumn('number', 'Popularity');
data.addRows([
['Germany', 200],
['United States', 300],
['Brazil', 400],
['Canada', 500],
['France', 600],
['RU', 700],
['India',1800]
]);

var options = {};

var chart = new
google.visualization.GeoChart(document.getElementById('chart_div'));
chart.draw(data, options);
};
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>
</html>


but unsuccessful.

Is it possible to load this in android WebView... I have declared
Internet Permission in Manifest file.
Pleas help me this.

asgallant

unread,
Mar 21, 2012, 10:50:07 AM3/21/12
to google-visua...@googlegroups.com, nix...@gmail.com
If you are using an Android version < 3.2 (honeycomb), SVG is not supported, so you cannot use the non-Flash-based charts (in the default Android browser anyway).

Atif Musaddaq

unread,
Mar 21, 2012, 11:00:28 AM3/21/12
to google-visua...@googlegroups.com
you have an option to generate a jpeg a static image of the chart. I don't remember how i did it couple of months ago but you can search on the internet. in my case it works fine and i was able to show the chart on the android enabled device.


atif

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/hSAjUskU7FcJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.



--
Atif Musaddaq

Pratik Patel

unread,
Mar 22, 2012, 3:31:35 AM3/22/12
to Google Visualization API
Thanks For your Reply..:)

Pratik Patel

unread,
Mar 22, 2012, 3:32:39 AM3/22/12
to Google Visualization API
Thanks for your reply.:)
Reply all
Reply to author
Forward
0 new messages