Jump to content
Software FX Community

Pie chart Legend


Recommended Posts

 I am creating a Pie chart and one of the legend labels is wrapping. I do not want the legend labels to wrapped so I made the width of the chart wider but when I did that the height of the chart grew which is not what I asked it to do. How can I make the legend labels not wrap?

Link to comment
Share on other sites

  • 2 weeks later...

Hello Jason,

There's no property to make the marker labels not to wrap but you have several options:

For a Pie Chart I would recommend to set the legends in the Legend Box instead of marker labels to increase the chart's readability. If you want you can create a separate Legend Box with an specific Width and Height to prevent the text wrapping. You could also create short labels and use the keyleg property.

Another option would be to change the font of the label to a smaller one using setPointLabelFont(java.awt.Font value) When setting a font in Chart FX, you must create a new font object with the desired attributes and assign that object to the desired chart element every time you want to change the font. 

I hope this helps,


Link to comment
Share on other sites

  • 1 year 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.

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...