I saw this link from google…
https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart
In this code..
<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 = google.visualization.arrayToDataTable([
['Country', 'Popularity'],
['Germany', 200],
['United States', 300],
['Brazil', 400],
['Canada', 500],
['France', 600],
['RU', 700]
]);
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>
is it possible to replace the contents of “function drawRegionsMap()”
with object coming from servelet and DAO?
im just curious…
I use google charts in my JSP projects all the time. Basically the way I get my data in the “function draw…()” is to generate the javascript server side containing all my own data, then sending it off to the JSP page in a normal java String object inserting it like this”
That way your generated javascript will run once you JSP page runs. It’s a difficult work around but if you look here you’ll get a better understanding of how I go about getting data from my server, generating the google-chart script server side, and then running it in my JSP page…
Hope this helped!