Geochart options

148 views
Skip to first unread message

donkey.k...@gmail.com

unread,
Jun 11, 2015, 11:38:56 AM6/11/15
to google-visua...@googlegroups.com
Hi,
 
I have two questions :
 
1. When using Region display we have 2 columns (country and data value which is a number). Is it possible to change the second criteria to text value?
 
2. How can I set an option to click on the country to redirect to an url?
 
Thank you

Sergey Grabkovsky

unread,
Jun 11, 2015, 11:53:44 AM6/11/15
to google-visua...@googlegroups.com
Hi,

1. The second column cannot be text. It needs to be a number that will get scaled and have a color assigned to it. What are you trying to do here? Are you looking to do something like series, where each country has a category?

2. You can listen for either the 'regionClick' event or the 'select' event, depending on if you want your handler to work for all regions ('regionClick' event), or just the ones you have data for ('select' event). You can attach a listener using google.visualization.events.addListener(chart, 'regionClick', function(r) { alert('Clicked ' + r.region) });

You would have to do the redirect yourself by modifying the browser's location.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

donkey.k...@gmail.com

unread,
Jun 11, 2015, 12:07:32 PM6/11/15
to google-visua...@googlegroups.com
1. I just want the Countries to show some text information when hover. I set the countries concerned to be a specific color, all the same color because I don't need to show different color depending on data values numbers.
 
2. Do you have an example, I'm not sure I understand.
 

On Thursday, June 11, 2015 at 5:53:44 PM UTC+2, Sergey wrote:
Hi,

1. The second column cannot be text. It needs to be a number that will get scaled and have a color assigned to it. What are you trying to do here? Are you looking to do something like series, where each country has a category?

2. You can listen for either the 'regionClick' event or the 'select' event, depending on if you want your handler to work for all regions ('regionClick' event), or just the ones you have data for ('select' event). You can attach a listener using google.visualization.events.addListener(chart, 'regionClick', function(r) { alert('Clicked ' + r.region) });

You would have to do the redirect yourself by modifying the browser's location.

On Thu, Jun 11, 2015 at 11:38 AM <donkey.k...@gmail.com> wrote:
Hi,
 
I have two questions :
 
1. When using Region display we have 2 columns (country and data value which is a number). Is it possible to change the second criteria to text value?
 
2. How can I set an option to click on the country to redirect to an url?
 
Thank you

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

Sergey Grabkovsky

unread,
Jun 11, 2015, 12:12:48 PM6/11/15
to google-visua...@googlegroups.com
If you simply want all the countries to be one color, you can easily do this by just providing one string column. This will cause all the locations to receive a value of null, which will be assigned a default color based on the option 'defaultColor'. Here's a simple example of this where I make the countries red: https://jsfiddle.net/ywss09q3/

Here is that same example, along with a simple 'regionClick' handler that shows an alert with what was clicked on: https://jsfiddle.net/ywss09q3/1/
And here is the same example, along with a simple 'select' handler that shows an alert with what was clicked on: https://jsfiddle.net/ywss09q3/2/

On Thu, Jun 11, 2015 at 12:07 PM <donkey.k...@gmail.com> wrote:
1. I just want the Countries to show some text information when hover. I set the countries concerned to be a specific color, all the same color because I don't need to show different color depending on data values numbers.
 
2. Do you have an example, I'm not sure I understand.
 

On Thursday, June 11, 2015 at 5:53:44 PM UTC+2, Sergey wrote:
Hi,

1. The second column cannot be text. It needs to be a number that will get scaled and have a color assigned to it. What are you trying to do here? Are you looking to do something like series, where each country has a category?

2. You can listen for either the 'regionClick' event or the 'select' event, depending on if you want your handler to work for all regions ('regionClick' event), or just the ones you have data for ('select' event). You can attach a listener using google.visualization.events.addListener(chart, 'regionClick', function(r) { alert('Clicked ' + r.region) });

You would have to do the redirect yourself by modifying the browser's location.

On Thu, Jun 11, 2015 at 11:38 AM <donkey.k...@gmail.com> wrote:
Hi,
 
I have two questions :
 
1. When using Region display we have 2 columns (country and data value which is a number). Is it possible to change the second criteria to text value?
 
2. How can I set an option to click on the country to redirect to an url?
 
Thank you

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

donkey.k...@gmail.com

unread,
Jun 11, 2015, 12:27:54 PM6/11/15
to google-visua...@googlegroups.com
I already set all the countries to be the same color. What I need is the text information. For example, when I hover the USA, it will shows a popup with some line text informations. Maybe with another code or another charts?
Thank you for the links

On Thursday, June 11, 2015 at 6:12:48 PM UTC+2, Sergey wrote:
If you simply want all the countries to be one color, you can easily do this by just providing one string column. This will cause all the locations to receive a value of null, which will be assigned a default color based on the option 'defaultColor'. Here's a simple example of this where I make the countries red: https://jsfiddle.net/ywss09q3/

Here is that same example, along with a simple 'regionClick' handler that shows an alert with what was clicked on: https://jsfiddle.net/ywss09q3/1/
And here is the same example, along with a simple 'select' handler that shows an alert with what was clicked on: https://jsfiddle.net/ywss09q3/2/

On Thu, Jun 11, 2015 at 12:07 PM <donkey.k...@gmail.com> wrote:
1. I just want the Countries to show some text information when hover. I set the countries concerned to be a specific color, all the same color because I don't need to show different color depending on data values numbers.
 
2. Do you have an example, I'm not sure I understand.
 

On Thursday, June 11, 2015 at 5:53:44 PM UTC+2, Sergey wrote:
Hi,

1. The second column cannot be text. It needs to be a number that will get scaled and have a color assigned to it. What are you trying to do here? Are you looking to do something like series, where each country has a category?

2. You can listen for either the 'regionClick' event or the 'select' event, depending on if you want your handler to work for all regions ('regionClick' event), or just the ones you have data for ('select' event). You can attach a listener using google.visualization.events.addListener(chart, 'regionClick', function(r) { alert('Clicked ' + r.region) });

You would have to do the redirect yourself by modifying the browser's location.

On Thu, Jun 11, 2015 at 11:38 AM <donkey.k...@gmail.com> wrote:
Hi,
 
I have two questions :
 
1. When using Region display we have 2 columns (country and data value which is a number). Is it possible to change the second criteria to text value?
 
2. How can I set an option to click on the country to redirect to an url?
 
Thank you

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
Message has been deleted

Sergey Grabkovsky

unread,
Jun 11, 2015, 12:29:52 PM6/11/15
to google-visua...@googlegroups.com
You can accomplish that with custom tooltips. Here is an example: https://jsfiddle.net/ywss09q3/3/

On Thu, Jun 11, 2015 at 12:29 PM <donkey.k...@gmail.com> wrote:
I already set all the countries to be the same color. What I need is the text information. For example, when I hover the USA, it will shows a popup with some line text informations. Maybe with another code or another charts?
Thank you for the links

--

donkey.k...@gmail.com

unread,
Jun 12, 2015, 3:35:45 AM6/12/15
to google-visua...@googlegroups.com
Many thanks for your help.
 
I have another question, is it possible to keep the region chart version, but to add some markers (only for the small countrie that we can't see in the world map). Or maybe there is a way to create a zoomable map so we can see these small countrie by zooming into them?

donkey.k...@gmail.com

unread,
Jun 12, 2015, 9:17:55 AM6/12/15
to google-visua...@googlegroups.com
Many thanks for your help!!
 
I have one last question:
 
Is it possible to set markers while using the region geochart and not the markers geochart? I mean, how can I add markers only for the small countries or cities because we can't see them with the region color
For example, if I want to have a map like the one you showed me, (https://jsfiddle.net/ywss09q3/3/), but with markers for Singapour, Bahrain, Hong Kong?
 
 

donkey.k...@gmail.com

unread,
Jun 12, 2015, 9:35:12 AM6/12/15
to google-visua...@googlegroups.com
Hey!
 
I tried using your code and add a third column but I get an error.
 
I can only have one information like this:
 
France
Information
 
But can I have something like this:
 
France
Information 1
Information 2
 
Thank you!

Sergey Grabkovsky

unread,
Jun 12, 2015, 9:45:21 AM6/12/15
to google-visua...@googlegroups.com
Hi, there isn't any way to add markers to a region map. This is something that we want to fix, but don't quite know how yet.

--

donkey.k...@gmail.com

unread,
Jun 19, 2015, 6:04:16 AM6/19/15
to google-visua...@googlegroups.com
Hi,
 
Do you know if I can use a code or a script to add a popup box when hover (or click)
 
I found this:
 
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display an alert box:</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
    alert("I am an alert box!");
}
</script>
</body>
</html>
But this code open the link in a window box and I want it to open in a dialog box

donkey.k...@gmail.com

unread,
Jun 19, 2015, 6:33:03 AM6/19/15
to google-visua...@googlegroups.com
Is it possible to have an image replacing the information in the map?
 
For example, when I hover a country, it shows a picture?
Reply all
Reply to author
Forward
0 new messages