Hi Chris, The series option is supposed to be a mapping of series index to series options. When you specify it as an array, you're basically doing that assignment implicitly. So in your example, series 0 will go on axis 1, and series 1 will go on axis 0. All other series will go to the default axis (0). Your issue could be fixed pretty easily, by simply reorganizing your series such that the total is the first series. Alternatively, you could explicitly specify that series 6 (your total series, 'country6') should go on axis 1. The default is for things to go on axis 0, so you don't need to explicitly specify that. Here's an updated version of your plunkr with the second version of the solution (since that was easier for me to do): http://plnkr.co/edit/GhsNcBCtDW0i4OTu0VJR?p=preview
On Thu, Dec 10, 2015 at 11:18 AM Chris <[email protected]> wrote: > I am creating a multiple line chart with Google Chart API where I want to > use 2 Y axis such as -> [![enter image description here][1]][1], but with > one axis set to max 24000 for my 6 countries, and the second set to 90000 > for the 'Total World' column. > > The problem is that my set of options never returns the 'Total World' in > the second y axis and the other 6 countries in the first y axis, no matter > how I arrange the option 'targetAxisIndex': > > > var tot = 95000; > var min = 0, var max = 24000; > .... > > > var options = { > title: 'Top Consuming Nations - Thousand barrels daily', > > hAxis: {title: 'Year'}, > width: 1050, height : 400, > > vAxes: [ > {title: 'Top Countries', titleTextStyle: {color: > '#FF0000'}, maxValue: max}, // Left axis maxValue: 60000 > {title: 'Total World', titleTextStyle: {color: '#FF0000' > }, maxValue: tot} // Right > ], > series:[ > {targetAxisIndex:1}, > {targetAxisIndex:0} > ], > legend: { position: 'top', alignment: 'start' } > }; > > > here is the complete code: > http://plnkr.co/edit/u5xXExdkTTYU8fHxWzHB?p=preview > > > > > [1]: http://i.stack.imgur.com/rdqtY.png > > -- > 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. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-visualization-api/561415e4-f12c-4b01-b7c3-94064fb5c954%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/561415e4-f12c-4b01-b7c3-94064fb5c954%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- [image: unnamed.gif] • • • • Sergey Grabkovsky Software Engineer Google, Inc [email protected] -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAEwwup6zJpMmcsY0ZD6d1xwMoaVfK0UWjdt0wFHAZs_ns7hMUw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
