CCS tags inside a Google map chart
-
I have the following Google map chart script inside a WordPress page.:
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', { 'packages':['geochart'], 'mapsApiKey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' }); google.charts.setOnLoadCallback(drawRegionsMap); function drawRegionsMap() { var data = google.visualization.arrayToDataTable([ ['Country', 'Companies'], ['Sweden', 1], ['China', 2], ['Switzerland', 2], ['Finland', 2], ['Germany', 3], ['Canada', 4], ['France', 2], ['Portugal', 1], ['Ukraine', 1], ['United Kingdom', 3], ['United States', 41] ]); var options = { colorAxis: {colors:['#d9534f','#d9534f']}, legend: 'none', }; var chart = new google.visualization.GeoChart(document.getElementById('regions_div')); chart.draw(data, options); } </script> <div id="regions_div" class="worldmap"></div>I need to generate the list of countries and the numbers associated with them in a programmatic way. To do so, the following CCS produces exactly the right syntax as required by the script:
[loop type=country] [set countryslug][field slug][/set] [pass vars] [if var=total_{COUNTRYSLUG} empty] ['[field title]', [get total_{COUNTRYSLUG}]],<br /> [/if] [/pass] [/loop]The problem is that if I place these CCS tags inside the script, no output gets generated. I assume the loop is not executed.
Any idea if it’s possible to do what I want to do and how?
Thank you
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘CCS tags inside a Google map chart’ is closed to new replies.