ios-charts is a cool library I'm using recently.
This is the expected highlighting slice:
This is my current highlighting effect:
The difference is the highlighted effect is too much than I expected.
I wonder which method can I use to adjust the highlighting effect?
Thanks for @Wingzero's answer.
However I do not want to change the source code or override some methods of it.
Finally, I found the property for the highlight effect of selected slice.
It is a property of @interface PieChartDataSet : ChartDataSet
.
/// indicates the selection distance of a pie slice
@property (nonatomic) CGFloat selectionShift;
By setting it as dataSet.selectionShift = 7.0;
, it works for my design.
Here attaches the object of dataSet:
PieChartDataSet *dataSet = [[PieChartDataSet alloc] initWithYVals:yVals1 label:NULL];
dataSet.selectionShift = 7.0;
PieChartData *data = [[PieChartData alloc] initWithXVals:nil dataSet:dataSet];
self.pieChartView.data = data;
This is the effect what I have expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With