Charts icon indicating copy to clipboard operation
Charts copied to clipboard

Add logic for relative positioning of pie chart icons

Open svyatoslav-zubrin opened this issue 4 years ago • 0 comments

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:

Screenshot 2021-02-26 at 11 27 28

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

svyatoslav-zubrin avatar Feb 26 '21 09:02 svyatoslav-zubrin