Data column(s) for axis #0 cannot be of type string

95 views
Skip to first unread message

TheMeggatrron

unread,
Nov 3, 2022, 12:18:54 AM11/3/22
to Google Visualization API
Hello,

I have developed a dashboard on my local computer using Xampp, PHP and MySql. Everything works great. But, when I upload it to my server I get the following error:
"Data column(s) for axis #0 cannot be of type string"
Here is the php code in the php file to call data from the MySql database.:

         var data = google.visualization.arrayToDataTable([
        ['Risk', 'Count',],
          <?php
          WHILE ($row = mysqli_fetch_array($AuditRiskRatingBarResult))
          {
            echo "['".$row["risk"]."', ".$row["tally"]."],";
          }
          ?>
      ]);

Again, it works as expected on two computers I have set up using Xampp. Pleas help.

Thank you.

SJW

unread,
Nov 22, 2022, 12:11:35 AM11/22/22
to Google Visualization API
Looks like risk is being output as a string instead of an integer but this is not enough information to say categorically.
Reply all
Reply to author
Forward
0 new messages