Sorry to bring up an old post...

My set selection.length isn't changing after selecting the first point.
Do you know if Google still uses the selection[0] = previous, selection[1] 
= current convention?
Any ideas on what might cause this?

On Wednesday, August 25, 2010 12:18:54 AM UTC-7, Dario wrote:
>
> worked like a charm, thanks! 
>
> On Aug 24, 8:31 am, Dario <[email protected]> wrote: 
> > Thanks Jré, will give this a try. 
> > 
> > D 
> > 
> > On Aug 23, 9:33 pm, Jré Sarenac <[email protected]> wrote: 
> > 
> > 
> > 
> > > This is how I did it for my pie chart. 
> > > Hope this helps! 
> > 
> > > Cheers, 
> > > Jré 
> > 
> > >       google.visualization.events.addListener(_pieChart, 'select', 
> > > mouseClickHandler); 
> > 
> > >       function mouseClickHandler() 
> > >       { 
> > 
> > >         var selection = _pieChart.getSelection(); 
> > >         var currentSelection = 0; 
> > 
> > >         //first selection has only length 1 because there is no 
> > > 'previous' selection 
> > >         if(selection.length == 1) 
> > >         { 
> > >           currentSelection = selection[0].row; 
> > >         } 
> > >         //all other selections are: selection[0] = previous, 
> > > selection[1] = current 
> > >         else 
> > >         { 
> > >           currentSelection = selection[1].row; 
> > >         } 
> > 
> > >         switch(currentSelection) 
> > >           { 
> > >            case 1: 
> > >               location.href = ('http://www.yoursite.com/'); 
> > >              break; 
> > >             case 2: 
> > >                 location.href = ('http://www.yoursite.com/'); 
> > >                 break; 
> > >             case 3: 
> > >                 location.href = ('http://www.yoursite.com/'); 
> > >                 break; 
> > >            case 4: 
> > >               location.href = ('http://www.yoursite.com/'); 
> > >               break; 
> > >             default: 
> > >               location.href = ('http://www.yoursite.com/'); 
> > >          } 
> > >       } 
> > 
> > > On Mon, Aug 23, 2010 at 1:29 PM, Dario <[email protected]> 
> wrote: 
> > > > Sorry for asking something probably trivial, but is there a simple 
> way 
> > > > to open a URL when a user clicks a bar in an interactive bar chart? 
> > 
> > > > -- 
> > > > You received this message because you are subscribed to the Google 
> Groups 
> > > > "Google Visualization API" group. 
> > > > To post to this group, send email to 
> > > > [email protected] <javascript:>. 
> > > > To unsubscribe from this group, send email to 
> > > > [email protected] 
> > > > <javascript:><google-visualization- 
> api%[email protected] <javascript:>> 
> > > > . 
> > > > For more options, visit this group at 
> > > >http://groups.google.com/group/google-visualization-api?hl=en.

-- 
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/groups/opt_out.

Reply via email to