Charts
Charts copied to clipboard
Add logic for relative positioning of pie chart icons
Goals :soccer:
Sometimes for pie charts with icons we want to be able to position icons not only with respect to the middle of the slice but with respect to the outer edge of the slice. Example:

Currently the only possible way to achieve this (that I've found) is to use PieChartDataSet.iconsOffset
property. It allows absolute adjustments of the icon position but fails when we need to do that dinamically (for different pie chart sizes e.g.).
Implementation Details :construction:
New property (iconsPosition
) added to PieChartDataSetProtocol
. Depending on the value of this property pie chart renderer will calculate and place the icon either with respect to the middle of the slice (for .iconCenterInTheMiddleOfSlice
option, default behaviour) or with respect to the outer edge of the slice (for .iconCenterOnOuterSliceRim
option).