The AnnotatedTimeline's configuration can't do what you want it to. By default, all lines are assigned to the left axis, and you can move 1 line only to the right axis. If you switch to using a LineChart<https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart>with a ChartRangeFilter<https://google-developers.appspot.com/chart/interactive/docs/gallery/controls#chartrangefilter>, you can easily set the lines to specific y-axes, which will automatically scale to fit the data. I wrote a migration tool<https://groups.google.com/d/msg/google-visualization-api/Y4ZmqWAjjPg/Uwr8eoWo6goJ>that you can use to test your chart as a LineChart+ChartRangeFilter. Your extra code to handle switching columns *probably* won't work with the tool, and the tool is not intended for production-level deployment; it's just something to get you started.
On Tuesday, August 13, 2013 8:52:54 AM UTC-4, Complex Confusion wrote: > > I'm trying to add features to a complicated Annotated Timeline ( > https://developers.google.com/chart/interactive/docs/gallery/annotatedtimeline). > > I've provided checkboxes for adding and hiding lines. It has two y-axes, > each of which represents a group of similar lines. (I'm making sure only 2 > groups of lines are displayed at a time.) > > The user is in control of which lines (or even which groups) will be shown > at any given time, so the lines used as the basis for the y-axis are set on > the fly. > > My question is: how do I scale a y-axis based on a group of lines? > Currently the y-axis only matches the scale of the line on which it's > based. How do I make that y-axis represent the scale of a group of lines? > Or conversely, how do I make a group of lines fit the scale of a particular > y axis? > > thanks! > -- 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.
