<html> <head> <script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script> <script type='text/javascript'> google.charts.load('current', {packages:['corechart']}); google.charts.setOnLoadCallback(draw1); google.charts.setOnLoadCallback(draw2); function draw1() { var data = google.visualization.arrayToDataTable([ ['Food', 'Amount'], ['1', 15], ['2', 33], ['3', 8], ['4', 12], ['5', 27] ]);
var options = { is3D: true, pieSliceText: 'value', legend: {textStyle: {color: 'AEAEAE'}}, tooltip: { text: 'value'} };
var chart = new google.visualization.PieChart(document.getElementById('piechart_3d')); chart.draw(data, options); } function draw2() { var data2 = google.visualization.arrayToDataTable([ ['Rating', 'Amount'], ['7', 4], ['6', 6], ['5', 7], ['4', 5], ['3', 3] ]);
var options2 = { pieHole: 0.6, legend: {textStyle: {color: 'AEAEAE'}} };
var chart2 = new google.visualization.PieChart(document.getElementById('chartdonut')); chart2.draw(data2, options2); } </script> </head> <body> <div id='piechart_3d' class='chart' style='width: 500px; height: 500px;'></div> <div id='chartdonut' class='chart' style='width: 500px; height: 500px;'></div> </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 google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/8cdf1cb8-fc88-4bc5-8a99-800f67a1936f%40googlegroups.com.
Thank you for this answer, is it possible that it causes a conflict with the rest of my code, because I put it in this
public function widget( $args, $instance ) {
//charts here
}
--
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 google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/77f3008a-051a-4ac3-b661-92fa7a6ff6e8%40googlegroups.com.
I made some tests, the conflict might be with my wordpress theme or the lightspeed cache plugin? Everything is fine if the page is outside the theme, but if I put the code on any page of my theme I only see the geo chart, then if i refresh the page I see the first pie chart appears, but it misses the two last charts. I made a try removing geo chart but I still only see the first pie chart.Here's a page as example : https://www.greenlightmotion.com/profile-2/hawerchuk/Thank you for your time.
--
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 google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/8cce60f8-9b12-4f42-8f6f-eb761b745bee%40googlegroups.com.
--
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 google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/9132279e-c606-45c0-ba01-408a118690eb%40googlegroups.com.