dun Posted December 5, 2008 Report Share Posted December 5, 2008 Hi, I am trying to disable the X axis labels without removing the scale. The Java API for the Class Axis states: You can easily remove all labels set to an axis with the DataValues.clear() method of the DataValues Class . But DataValues.clear() actually removes all the values in the chart. A quick hack in the case of a plain color background would be to set the font colors to the same as the background, but that's definitely not the right solution... Is there any other way to achieve this that I am missing? Thanks, Dogan Quote Link to comment Share on other sites More sharing options...
TomasT Posted December 8, 2008 Report Share Posted December 8, 2008 Hi, You can use the Style property of the axis to hide the labels for any particular axis. Try with the following code: Set<AxisStyles> s = chart1.getAxisX().getStyle(); s.add(AxisStyles.HIDE_TEXT); chart1.getAxisX().setStyle((EnumSet<AxisStyles>) s ); Hope this helps. TT Quote Link to comment Share on other sites More sharing options...
dun Posted December 8, 2008 Author Report Share Posted December 8, 2008 Thanks TomasT, that's exactly what I was looking for. Quote Link to comment Share on other sites More sharing options...
jmeessem Posted February 21, 2009 Report Share Posted February 21, 2009 I tried this exact code on the Y axis, but it does not work. Any ideas on what to do to turn off the Y Axis labels? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.