Nathan Tsai
Nathan Tsai

Reputation: 21

How do you add slice spacing to just the selected item of a pie chart with iOS Charts in Swift 3?

I am using the Charts library by Daniel Gindi. I am able to set my delegate and have a function run whenever a slice is selected, but the line pieChartDataSet.sliceSpace sets the spacing for the entire chart instead of just one slice.

Here is an example of what I want to achieve:

enter image description here

Thanks for your help.

Upvotes: 1

Views: 1217

Answers (2)

Ubaid Bhatti
Ubaid Bhatti

Reputation: 11

chartView.highlightValue(x: 0, dataSetIndex: 0)

Upvotes: 1

Wingzero
Wingzero

Reputation: 9754

This pieChartDataSet.sliceSpace is for highlight feature, and you just have to write code to highlight the slice you want.

Take a look at drawHighlighted() in pie chart renderer.

Upvotes: 0

Related Questions