Click here to Skip to main content
16,022,069 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Am using google geo chart for country name and value displayed, but "Scotland" not show in my map.

[EDIT]
Transferred from a "solution":

Thanks for your reply

my code is

<pre>function drawRegionsMap() {

                var data = google.visualization.arrayToDataTable([
                    ['Country', 'Popularity'],
                    ['United Arab Emirates', 109], ['Australia', 36], ['United States', 56], ['United Kingdom', 71], ['Scotland', 186], ['Russia', 95], ['Japan', 65],
            
                ]);

                var options = {
                    //backgroundColor: 'transparent',
                    //responsive: true,
                    legend: 'none',
                    //height: 450,
                    //width: 725
                    keepAspectRatio: false,
                    colorAxis: { colors: ['#2190d1', '#f97b42'] }

                };

                var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));

                google.visualization.events.addListener(chart, 'select', function () {
                    var selection = chart.getSelection();
                    if (selection.length > 0) {

                        console.log(selection);
                        console.log(selection[0].row);
                        window.location.href = '/admin/studentinfo/index?scid=' + countryselId[selection[0].row]
                        
                    }
                });

                chart.draw(data, options);                
            }


other county name and value display in my map but "Scotland" only not show.
[/EDIT]

What I have tried:

am added country name and value but not show in map
Posted
Updated 31-Jul-24 3:41am
v3
Comments
[no name] 31-Jul-24 8:17am    
You should complain to Google.
Richard Deeming 31-Jul-24 11:46am    
Last time I checked, Scotland is still part of the United Kingdom. Adding different values for both makes no sense.

The documentation[^] seems to suggest you could use "England", but that doesn't work for me.

So as RMC said, you'll need to complain to Google.

1 solution

What you see depends, to some extent, on the zoom level you are looking at. If you look at this[^] on a PC screen, you just see United Kingdom. Zoom in one level to this[^], and you see the country name (you have to look right to the top of Scotland to see the name).

As we can't see your code, or your screen, we have no better idea as to what else could be going on. When asking questions, you have to assume that the person you are asking the question of does not have the full context that you have, so it is up to you to provide as much detail as possible. Without this, you are unlikely to get any clearer answer than this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900