Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5124
XamPieChart slices too small to select
posted

What are some options when a pie slice is too small to select?  E.g., if one slice's value is 15,000, and another is 2, the mouse pointer does not actually hover over the small slice.

I would like to do one or both of the following:

1. Set a minimum arc length of small slices so they remain selectable - even though the visual proportion becomes inaccurate.

2. Allow the user to select the slice by selecting the corresponding legend item.

I can't find any pointers for either of these ideas.  Any help would be greatly appreciated.

Parents
No Data
Reply
  • 12875
    Verified Answer
    posted

    Hi Francis,

    I’m attaching my sample that shows the xamPieChart’s  SliceClick event which is raised when you click on a slice and the associated code to set the isExploded and IsSelected properties.

    You can use the Legend’s LegendItemMouseLeftButtonDown for the legend items.  You’ll see the code I used to add the item to the SelectedSlices and the ExplodedSlices .

    There is also some code to display which slices are currently included in the SelectedSlices collection.  You’ll notice that when the slice is extremely small it is still not visible. 

    If you have a number of very small slices you might rather include them in the Other category with the following settings.  The OtherCategoryType can use Number or Percent.

    OthersCategoryThreshold="50"

    OthersCategoryType="Number"

    OthersCategoryText="Others"

    Let me know if this solves your question.

    SL_xamPieChart.zip
Children