Amazing answer, thanks, works perfectly.

Nate

On Wednesday, September 12, 2012 3:51:56 PM UTC-7, asgallant wrote:
>
> How you go about it depends on whether or not you have set the 
> "forceIFrame" option to false or not (currently defaults to true, will soon 
> default to false) - setting it to true renders the charts in an iFrame, 
> false without the iFrame (in all browsers other than IE < 9).  If you have 
> not set the forceIFrame option to false, then use this:
>
> google.visualization.events.addListener(chart, 'ready', function () {
>     if ($.browser.msie && $.browser.version < 9) {
>         $('#chart_div').find('iframe').contents().find('group').click(
> function () {
>             alert('test');
>         });
>     }
>     else {
>         $('#chart_div').find('iframe').contents().find('svg').click(
> function () {
>             alert('test');
>         });
>     }
> }); 
>
> if you have set it to false, then use this:
>
> google.visualization.events.addListener(chart, 'ready', function () {
>     if ($.browser.msie && $.browser.version < 9) {
>         $('#chart_div').find('iframe').contents().find('group').click(
> function () {
>             alert('test');
>         });
>     }
>     else {
>         $('#chart_div').find('svg').click(function () {
>             alert('test');
>         });
>     }
> }); 
>
> The latter case is recommended, as the default value of the option will 
> change soon anyway.
>
> On Wednesday, September 12, 2012 5:47:48 PM UTC-4, Nate Sanden wrote:
>>
>> I tried jquery:
>>
>>     $('#dan_basic_chart_1').click(function () {
>>        alert('test');
>>     });
>>
>> but alert is not firing.
>>
>> I see a 'select' event but from what I understand that only works when I 
>> click a data point, bar or line, etc in a chart.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/_LfMvUta-t8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to