Jump to content
Software FX Community

Is there a way to create "callouts" for labels?


Recommended Posts

We have an ask to have the values on a pie chart to be outside of the chart (rather than in the center of each piece).  Is this something natively supported, or are more involved methods required?  If so, can you point me in the right direction, please?


Link to comment
Share on other sites

Each of our gallery objects support specialization, in the case of pie, we have a couple of properties including the one you need. In code you would have to do

chart1.Gallery =

Gallery.Pie;ChartFX.WPF.Galleries.Pie pieAttributes = (ChartFX.WPF.Galleries.Pie) chart1.AllSeries.GalleryAttributes;pieAttributes.LabelsInside = false;

Note that the cast to ChartFX.WPF.Galleries.Pie will throw if you have not set the Gallery to Pie beforehand. If you have multiple series they will share the same attributes but you can also create Pie objects and assign them on a per-series basis. You can also do it in XAML as follows


cfx:Chart x:Name="chart1">  <cfx:Chart.AllSeries>   <cfx:AllSeriesAttributes>   <cfx:AllSeriesAttributes.GalleryAttributes>   <cfxGalleries:Pie LabelsInside="false"/>   </cfx:AllSeriesAttributes.GalleryAttributes>   </cfx:AllSeriesAttributes>  </cfx:Chart.AllSeries></cfx:Chart>

PS: There is a sizing issue with small charts when using outside labels because we have an alternate property that controls how small should the plotarea result. If you experience label clipping you might need to do this

chart1.PlotArea.MinSize = 0;



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.

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