Skip to content
Advertisement

Draw multiple Google pie charts in for loop

Here is what I’m trying to do. I’m trying to place multiple Google Pie Charts, I already put the code in, however, I’m getting the following error message:

Uncaught TypeError: Cannot read property ‘arrayToDataTable’ of undefined and I’m getting another error message: Error: Data for arrayToDataTable is not an array.

Here is the code that I’m using right now:

JavaScript

Here is the google chart code:

JavaScript

What could be causing the issues?

Thanks!

Advertisement

Answer

I have found a solution. What I did was split up the JS code and put the code together in the PHP for loop.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement