rotating domain label texts on xyplot graph

373 views
Skip to first unread message

amit c

unread,
Jul 11, 2013, 3:11:16 PM7/11/13
to andro...@googlegroups.com
Hi
Facing issues while setting the orientation of domain axis labels.I need the labels to be tilted by some angle.or even vertical placement of labels would do on x axis.

Tried setting set orientation method but didn't work out..anything else that you can suggest?

I am using 0.5.2 version

Thanks,
Amit

Nick

unread,
Jul 13, 2013, 5:26:40 PM7/13/13
to andro...@googlegroups.com
Hi Amit,

The setOrientation method(s) are actually for rotating the text labels annotating the entire dimension; the label that reads "X-Axis" or "Y-Axis" for example.  Based on what you said above it sounds like what you really want to do is rotate the tick labels that show up on each domain grid line.  Up til now there has been no way to accomplish this.  I went ahead and added 4 new methods to XYGraphWidget to handle this: 

void setDomainLabelOrientation(float)
float getDomainLabelOrientation(void)
void setRangeLabelOrientation(float)
float getRangeLabelOrientation(void)


If for example, you wanted to add a rotation of -45 degrees to your domain labels you would do this:

plot.getGraphWidget().setDomainLabelOrientation(-45);

Which would result in this: 


Nick

unread,
Jul 13, 2013, 5:30:30 PM7/13/13
to andro...@googlegroups.com
PS.

The updated library jar is available in the latest build of 0.6.0.  I also modified the SimpleXYPlotExample in the DemoApp to include the example image above.

amit c

unread,
Jul 14, 2013, 2:09:44 PM7/14/13
to andro...@googlegroups.com
Thanks Nick.

Will download the latest build tomorrow and will give you a feedback on it :)
Reply all
Reply to author
Forward
0 new messages