Jump to content
Software FX Community

Disable Axis labels wihtout removing scale


dun

Recommended Posts

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • 2 months later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...