Try:
wrapper.setOption('series.' + i + '.targetAxisIndex', 1);
if you want to change just the targetAxisIndex (instead of overwriting the
whole series.<series index> option), or this:
var series = {};
for (var i = 1; i < columns; i++) {
var maxRange = data.getColumnRange(i);
if (maxRange.max > 1000) {
series[i] = {targetAxisIndex: 1};
}
}
wrapper.setOption('series', series);
If you want to overwrite the whole series option.
On Friday, September 27, 2013 3:08:43 PM UTC-4, Tribblehunter wrote:
>
> Hi all.
>
> Trying to automatically assign the right axis to anything in my data table
> above 1000.
>
> can not get this code to work. New to javascript and learning fast. Any
> pointers appreciated.
>
> !function () {
> for (var i = 1; i < columns; i++) {
> var maxRange = data.getColumnRange(i);
> if (maxRange.max > 1000) {
> alert(maxRange.max);
> alert(i);
> wrapper.setOption('series',{(i):{targetAxisIndex:1}});
> };
> }
>
> }()
>
> I believe it is the last bit that is wrong. I wish to work this out and
> would appreciate a nudge in the right direction, or a clue.
>
> Many 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.