daviddam Posted July 9, 2008 Report Share Posted July 9, 2008 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? Thanks! Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 9, 2008 Report Share Posted July 9, 2008 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;Regards, JuanC Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 9, 2008 Report Share Posted July 9, 2008 I forgot to say that if you use the XAML approach you need the following namespace at the root element in your xaml xmlns:cfxGalleries="clr-namespace:ChartFX.WPF.Galleries;assembly=ChartFX.WPF"JuanC Quote Link to comment Share on other sites More sharing options...
daviddam Posted July 10, 2008 Author Report Share Posted July 10, 2008 Thank you again for your prompt reply! David 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.