Hi,

The Gauge chart actually doesn't have support for either the getSelection()
method nor the 'select' event. However, since you are only rendering one
gauge chart at any given time, you don't really need to know what to
render, since your DataTable will only have one row. So instead of
listening for the 'select', you can just listen for the click event on the
chart container. For some reason, jsfiddle won't let me post this code, but
here's a snippet of what you need to write:

document.getElementById('gauge1').addEventListener('click', function () {
    // selection is an array of objects with {row, column} properties,
    // use them to get data from your DataTable if you need to, ie:
    var selectedValue = gauge1.getDataTable().getValue(0, 1);
    // you can then emulate clicking a link from here
    alert('You clicked on  ' + selectedValue );
    window.location.href = "http://www.google.com/";;
});

On Mon Jan 05 2015 at 11:23:25 AM <[email protected]> wrote:

> Hi everyone,
>
> I have a gage with a dropdown and would like to be able to click the gauge
> and navigate to the record that was selected from the dropdown.  I found
> some help on your message board about how to make a chart emulate a
> hyperlink and I've added the following code but it doesn't seem to do
> anything.  It doesn't cause an error or anything either.  It just does
> nothing:
>
>
>     google.visualization.events.addListener(gauge1, 'select', function () {
>     var selection = gauge1.getSelection();
>     // selection is an array of objects with {row, column} properties,
>     // use them to get data from your DataTable if you need to, ie:
>     var selectedValue = gaugeData.getValue(selection[0].row,
> selection[0].column);
>     // you can then emulate clicking a link from here
>     alert('You clicked on  ' + selectedValue );
>     window.location.href = "http://www.google.com/";;
> });
>
>
> Here is a jsfiddle with all my logic.  Any advice you can offer is greatly
> appreciated.
> http://jsfiddle.net/sremias/y9nq2bqe/3/
>
>
>  --
> 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