Hi,

We don't have any built-in functionality for creating links in charts, but
we do provide multiple ways via which you could do this yourself. You can
do this in one of 3 distinct ways:

   1. Set the tooltip.trigger option to be 'selection' or 'both' (so that
   tooltips appear when things are selected, instead of when they're hovered),
   enable HTML tooltips (for the links), and provide custom tooltips with a
   link coded into them. Here is an example of this approach
   <http://jsfiddle.net/blindmonkey/r7uqn9k2/>.
   2. Listen for the 'select' event from the chart. Here is an example of
   this approach <http://jsfiddle.net/blindmonkey/r7uqn9k2/1/>.
   3. Listen for the 'regionClick' event from the chart. Here is an example
   of this approach <http://jsfiddle.net/blindmonkey/r7uqn9k2/2/>.

The downside of approaches 2 and 3 is that you have to use a separate data
structure to keep track of the mapping between countries and links, unless
you want to use a DataView.

On Wed, Jun 17, 2015 at 5:43 PM A.S. <[email protected]> wrote:

> I would like to create links on a geochart.
>
> Current code is:
>
> <script type="text/javascript" src="https://www.google.com/jsapi
> "></script>
> <script type="text/javascript">
>
> google.load("visualization", "1", {packages:["geochart"]});
> google.setOnLoadCallback(drawRegionsMap);
>
> function drawRegionsMap() {
> var data = google.visualization.arrayToDataTable([
>      ['Country', 'Popularity'],
>      ['US', 4],
>      ['CA', 22],
> ]);
>
> var options = {
>  region: 'world'
>  };
>
> var chart = new google.visualization.GeoChart(document.getElementById(
> 'regions_div'));
> chart.draw(data, options);
> }
> </script>
>
>
> I would like to be able to click on one of the countries (US or Canada, in
> this example) and link to a page. Any ideas?
>
> --
> 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 [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to