Display label outside of Pie chart


#1

I read this post
https://www.shinobicontrols.com/blog/pie-chart-labels-that-are-out-of-this-slice
but I’m getting crash at getSliceCenter for “index 0 beyond bounds for empty array”
I’m wondering if there’s any Swift version I can refer to


#2

Hi spikereg,

If you’re trying to add spokes to your pie chart then, since v2.8.0 of shinobicharts, there’s a much easier way than that described in the blog post. Spokes are now supported out-of-the-box and are enabled by setting style.spokeStyle.showSpokes = YES on the pie/donut series’ style object.

There’s a more detailed explanation of how to use spokes in the shinobicharts userguide.

I hope that helps.

Alison


#3

Thanks for your answer! The problem is, that certain slices could have the same background color since these can be assigned by the users. This means that users can no longer distinguish which one which is.


#4

Hi @klimbo23,

If you have multiple slices that are the same color, then adding data point labels should help distinguish them. You can read more about adding labels to pie or donut charts at https://www.shinobicontrols.com/docs/ios/shinobicharts/latest/labels-and-legends.html

I hope that helps.

Alison