Question

I'm looking for a free iOS component that allows me to draw a doughnut chart with text in the center. So far I've only used Code Plot, but that is a full pie chart.

I'm attaching an example of the requirement.

doughnut design

Any help will be much appreciated.

Was it helpful?

Solution

I suggest searching on cocoacontrols.com. They have lots of open source controls for iOS and Mac. I didn't se any specifically called "doughnut chart" but some of the pie charts controls might offer that option.

In fact, it seems that this one does include what you're calling a doughnut chart. It doesn't look like it has built-in support for a label in the middle, but it does create a ring-shaped chart like you want.

You could also always create a pie chart and then put a view on top of it that is transparent except for a white circle in the middle, and then put a label on top of that.

Getting a little more complex you could modify the CorePlot control and add a filled CAShapeLayer to it.

OTHER TIPS

Another option is to create svg chart and use UIWebView to display it. With svg chart, you get much more flexibility with libraries like highcharts and d3js. Here's an example with donut chart:

http://vida.io/documents/Byh8tTakzB59oGa9f

You can embed the link or save svg and display in UIWebView. Saving svg works offline.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top