Hi, this isn't actually a bug in the charts, but more of a bug in the
documentation. Most of our charts are rendered asynchronously, and so, the
chart may or may not be done rendering when you call getImageURI. We are
fixing our documentation right now, but the correct way to do this is to
call getImageURI when the chart throws its 'ready' event. This event is a
signal that the chart has done rendering.

I have attached a fixed version of your sample page, but here is
essentially how you listen for the event:
   google.visualization.events.addListener(chart, 'ready', function() {
     // Call getImageURI here.
   });

- Sergey


On Mon, Feb 24, 2014 at 3:36 PM, mani vannan <[email protected]>wrote:

>  <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> <title>Insert title here</title>
> <script type="text/javascript" src="https://www.google.com/jsapi";></script>
>
>   <script type="text/javascript">
>   google.load('visualization', '1', {'packages': ['geochart']});
>   google.setOnLoadCallback(drawMarkersMap);
>
>    function drawMarkersMap() {
>    var data = google.visualization.arrayToDataTable([
>      ['City',   'Population', 'Area'],
>      ['Rome',      2761477,    1285.31],
>      ['Milan',     1324110,    181.76],
>      ['Naples',    959574,     117.27],
>      ['Turin',     907563,     130.17],
>      ['Palermo',   655875,     158.9],
>      ['Genoa',     607906,     243.60],
>      ['Bologna',   380181,     140.7],
>      ['Florence',  371282,     102.41],
>      ['Fiumicino', 67370,      213.44],
>      ['Anzio',     52192,      43.43],
>      ['Ciampino',  38262,      11]
>    ]);
>
>    var options = {
>      region: 'IT',
>      displayMode: 'markers',
>      colorAxis: {colors: ['green', 'blue']}
>    };
>
>    var chart = new 
> google.visualization.GeoChart(document.getElementById('chart_div'));
>    chart.draw(data, options);
>
>   chart_div.innerHTML = '<img src="' + chart.getImageURI() + '">';
>
> };
>
>       </script>
> </head>
> <body>
> <div id="chart_div" style="width: 900px; height: 500px;"></div>
>
>
> </form>
> </body>
> </html>
>
>   --
> 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 [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.
Title: Insert title here
​

Reply via email to