Here is an example that draw two charts using the same data:
http://jsfiddle.net/peshtj0L/1/

Each chart must have its own container element but you can share the data.
You can draw them both in the one function that is called after the library
has finished loading (the function you specify in your
google.setOnLoadCallback()).

On Sun, May 31, 2015 at 7:03 PM, PavolK <[email protected]> wrote:

> I'm actually wondering about the same thing. Tried a couple of options but
> haven't figured it out yet.
>
>
> On Monday, June 1, 2015 at 12:42:00 AM UTC+2, Antonio Martínez Cruz wrote:
>>
>> I dont know how , I have this thing
>>
>> <html>
>> <TITLE>Proyecto 3</TITLE>
>>
>>
>>     <script type="text/javascript" src="https://www.google.com/jsapi
>> "></script>
>>     <script type="text/javascript">
>>       google.load("visualization", "1", {packages:["corechart"]});
>>       google.setOnLoadCallback(drawChart);
>>       function drawChart() {
>>
>>         var data = google.visualization.arrayToDataTable([
>>           ['Task', 'Hours per Day'],
>>           ['Nada',     4],
>>           ['Eat',      233],
>>           ['Estar con el perro',  0.2],
>>           ['Reir', 0.5],
>>           ['Acomodar los sillones',    7]
>>         ]);
>>
>>         var options = {
>>           title: 'My Daily Activities'
>>         };
>>
>>         var chart = new
>> google.visualization.PieChart(document.getElementById('piechart'));
>>
>>         chart.draw(data, options);
>>       }
>>
>>
>>
>>
>>     </script>
>>   </head>
>>   <body>
>>     <div id="piechart" style="width:500px; height: 500px;"></div>
>>
>>   </body>
>> </html>
>>
>> But I dont know if I should change something in div id , or in the
>> function
>>
>  --
> 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/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>  -
978-394-1058
[email protected] <[email protected]>   5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton MA

-- 
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/d/optout.

Reply via email to