I already tried all of that, but now i finally found the problem, it was a conflict with the plugin Lightspeed cache, the option "Load Google Fonts Asynchronously" was activated, I deactivated it and now everything is perfect. I appreciate your help, my brain was about to explode, have a good day!
Le lundi 25 mai 2020 21:44:06 UTC-4, piano lab a écrit : > > I don't like to ask for help but now I think it's time since everything > seems to be coded as the Google Guide recommends. What's wrong with my > code? Only the first chart appears. Thank you for help. > > <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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/9132279e-c606-45c0-ba01-408a118690eb%40googlegroups.com.
