Further Update: I can sort of solve problem 2) (2nd and third Y Axis scales overlay each other) by specifying textPosition : 'in' for the third axis scale. This puts the text inside the scale which makes it readable, if a bit messy. Still looking for a way to put the 2nd and 3rd scales outside the chart. Thanks!
On Thu, Mar 21, 2013 at 9:16 AM, Thomas Rybka <[email protected]> wrote: > We are in the process of updating the options classes in GWT, but you > should be able to achieve this by wrapping JS code in GWT. > > You can use JSNI like this: > > *private native Options createOptionsWithMultipleSeries() /*-{* > * options = {* > * curveType: "function",* > * width: 500,* > * height: 400,* > * vAxes: {0: {logScale: false},* > * 1: {logScale: false, maxValue: 10}* > * },* > * series:{* > * 0:{targetAxisIndex:0},* > * 1:{targetAxisIndex:0},* > * 2:{targetAxisIndex:1}* > * }* > * };* > * return options;* > *}-*/;* > > You can leave out as much of the JS as you can achieve in GWT, and use > Java methods on the resulting Options object as well. > > Cheers, > Tom > > > Thomas Rybka | Software Engineer | [email protected] | GViz > > > On Wed, Mar 20, 2013 at 3:56 PM, Steve Morgan <[email protected]>wrote: > >> I would like to be able to create multiple scales for the Y axis of a >> LineChart. I have found a JavaScript example of how to do this (below), but >> I am coding in Java for a GWT application. The problem is that I can't >> figure out how to set series values in Java. I have come across >> com.google.gwt.visualization.client.visualizations.corechart.Series >> (undocumented), but there doesn't seem to be a way to set targetAxisIndex >> for a Line Chart. Can anyone point me to a code example? Do I need to use >> one of the wrapper libraries for GWT/Visualization or has that >> functionality been migrated back into the Google visualization API? >> Thanks! >> >> // Create and draw the visualization. >> new >> google.visualization.LineChart(document.getElementById('visualization')). >> draw(data, {curveType: "function",width: 500, height: 400, >> vAxes: {0: {logScale: false}, >> 1: {logScale: false, maxValue: 10}}, >> series:{ >> 0:{targetAxisIndex:0}, >> 1:{targetAxisIndex:0}, >> 2:{targetAxisIndex:1}}} >> ); >> >> >> -- >> 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?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Google Visualization API" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/google-visualization-api/ER4722vGm6Q/unsubscribe?hl=en > . > To unsubscribe from this group and all its topics, 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?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
