Jump to content
Software FX Community

Adding labels to Pie Chart points (TagLib)


mcstoufer
 Share

Recommended Posts

I couldn't find any examples showing how to add additional text as a label to each point in a chart. I thought the use of Series and SeriesAttribute would help, but no go. The use of a legend is a final option for me. 

BTW, as the title shows, I'm trying to get this done with the cfxjava TagLib. 

Link to comment
Share on other sites

You can set that up with the PointLabelMask, here is a example:

<chartfx:chart height="400" width="600" gallery="pie" NSeries="1" NValues="3" pointLabels="true" pointLabelMask="Value %v: Represents %p%%">

  <chartfx:pie shadows="true" labelsInside="false"/>

</chartfx:chart>

Look at the Chart.setPointLabelsMask api doc for the list od availabe % "wilcards"

 

 

Link to comment
Share on other sites

That's why I couldn't find that parameter, it was up in the chart element.  My current working solution is to modify the label elements inside the legend. This  works in a  static manner, but fails to compile when I encapsulate them with a c:forEach tag.  I submitted a bug report for this (120875)

 Snippet:

<chartfx:legend>   <c:forEach items="${pieChartBean.headerSet}" var="header" varStatus="headerStatus">   <chartfx:label index="${headerStatus.index}" label="${header}"/>   </c:forEach></chartfx:legend>

 Is there an 'unsafe' fix I can make to the taglib jar on my side to inhibit this checking?

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...