Hi,

Currently I am using new feature provided by Google API to store the chart 
as PNG. After drawing the chart we need to call the new method 
getImageURI() to render the PNG format of the chart.

<https://lh6.googleusercontent.com/---zqod63pzI/UxDmkQukmVI/AAAAAAAAAhg/dlHz206AXEc/s1600/line_chart_png.png>
However for LineChart, i am seeing a different behaviour. The PNG for 
Linechart is filled with black color in the area between the trend lines. 
Below is the sample code. I am experiencing this behaviour on Firefox and 
other browsers. Please suggest if there is any way to remove the black 
color from the background.

<html>
  <head>
    <script type="text/javascript" 
src="https://www.google.com/jsapi";></script>
    <script type="text/javascript">
      google.load("visualization", "1.1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Year', 'Sales', 'Expenses'],
          ['2004',  1000,      400],
          ['2005',  1170,      460],
          ['2006',  660,       1120],
          ['2007',  1030,      540]
        ]);

        var options = {
          title: 'Company Performance',
  
  };

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


Thanks

-- 
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.

Reply via email to