简体   繁体   中英

How to dynamically add values to google geochart through mysql?

I have to add dynamic data to google geochart through mysql or database so that when i update values from backend it automatically gets displayed on google geocharts functionality that i will embed using php language. Can anyone please help me on this. I have one refereence link: https://developers.google.com/chart/interactive/docs/gallery/geochart

After you start developing the maps and php script, you just need to create a cicle where you include the data from the database.

I wont be very specific, but something like:

function drawRegionsMap() {
        var data = google.visualization.arrayToDataTable([
          ['Country', 'Popularity'],

          <?php while () { ?>
          ['<?php echo $row['country']; ?>', <?php echo $row['value']; ?>],
          <?php } ?>

          ]);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM