Okay, here is the code for the pie chart from the source code;
<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(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Task', 'Bots Caught'],
          ['Wait Script', 169],
          ['Text Removal', 18],
          ['Honeypot / Hidden Question', 0],
          ['Custom Question', 0],
          ['SFS Blacklist', 0],
          ['BotScout Blacklist', 0],
          ['FSpamlist Blacklist', 0]
        ]);

        var options = {
          title: 'Honeypot Blocker Results PieChart',
          is3D: true,
                  backgroundColor: '#f8ce55',
                  titleTextStyle: {color: '#000000', fontSize: '32px'},
                  legendTextStyle: {color: '#000000', fontSize: '16px'},
                  colors: ['#00A209', '#486EFF', '#AB00BC', '#C30012', 
'#D08E00', '#00C3B4', '#77D100'],
        };

        var chart = new google.visualization.PieChart(document.
getElementById('piechart_3d'));
        chart.draw(data, options);
      }
    </script>

Then after it, the div is called.

<div id="piechart_3d" style="width: 700px; height: 500px;"></div>
I don't see why it would be stating "a is not a function" instead of the 
pie chart.
I also can't figure why this is happening on 2 of the 5 sites this is being 
tested on.


On Sunday, October 9, 2016 at 2:23:15 PM UTC-4, Derek McGuire wrote:
>
> I have s script I developed for a CMS and I have been implementing the 
> Google Piechart into the system. I just put the updates on my site and a 
> few test sites from the CMS community, and on 2 of the 5 sites, and error 
> occurs with the piechart.
> I am trying to figure out why on these 2 sites, its not working. The error 
> is instead of displaying the piechart as expected, it displays "*a is not 
> a function*". 
> Below are 2 images, The first screenshot is it working on one of the test 
> sites and the other is where it's not. The code that is being used is as 
> follows.
>
>   echo '<script type="text/javascript" src="
> https://www.gstatic.com/charts/loader.js";></script>' , PHP_EOL
>       ,'    <script type="text/javascript">
>       google.charts.load("current", {packages:["corechart"]});
>       google.charts.setOnLoadCallback(drawChart);
>       function drawChart() {
>         var data = google.visualization.arrayToDataTable([
>           [\'Task\', \'Bots Caught\'],
>           [\'Wait Script\', '.$waitscript.'],
>           [\'Text Removal\', '.$textremoval.'],
>           [\'Honeypot / Hidden Question\', '.$hidden.'],
>           [\'Custom Question\', '.$customquestion.'],
>           [\'SFS Blacklist\', '.$sfsspam.'],
>           [\'BotScout Blacklist\', '.$bscheck.'],
>           [\'FSpamlist Blacklist\', '.$fscheck.']
>         ]);
>
>         var options = {
>           title: \'Honeypot Blocker Results PieChart\',
>           is3D: true,
>  backgroundColor: \''.$rowcolor2.'\',
>  titleTextStyle: {color: \''.$fontcolor.'\', fontSize: \'32px\'},
>    legendTextStyle: {color: \''.$fontcolor.'\', fontSize: \'16px\'},
>  colors: [\'#00A209\', \'#486EFF\', \'#AB00BC\', \'#C30012\', \'#D08E00\', 
> \'#00C3B4\', \'#77D100\'],
>         };
>
>         var chart = new 
> google.visualization.PieChart(document.getElementById(\'piechart_3d\'));
>         chart.draw(data, options);
>       }
>     </script>' , PHP_EOL;
>
>
> Working
>
>
> <https://lh3.googleusercontent.com/-gbLVm3QjSbA/V_qKciWxpgI/AAAAAAAAAI8/CSg4TpRAiq8WGOjCu4BTpclz9CH9NuPSwCLcB/s1600/working.jpg>
>
>
> Not working
>
>
> <https://lh3.googleusercontent.com/-TZozlop-DSM/V_qKpsHlsDI/AAAAAAAAAJE/VE27LQ9AH6o5R_tMBOY9EOhzJW-s7OuFgCLcB/s1600/error.jpg>
>
>
> Anyone have any ideas why this does work on 3 out of the 5 sites and on 2 
> of them, it would display the error  "*a is not a function*"? Any help 
> would be appreciated.
>
>

-- 
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-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/f2e3034c-7aff-47da-bc94-399c82de32c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to