3

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.

Andres SK
  • 10,779
  • 25
  • 90
  • 152

2 Answers2

5

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.

Johnykutty
  • 12,091
  • 13
  • 59
  • 100
Duncan C
  • 128,072
  • 22
  • 173
  • 272
2

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.

Phuoc Do
  • 1,344
  • 10
  • 14
  • yes, but this would consume bandwidth in my server, we are expecting lots of requests. it is far better to just send a json with the percentage info (a few bytes) and then parse it in the app. – Andres SK Oct 25 '13 at 18:33
  • You can write javascript in UIWebView to request json and render the chart. – Phuoc Do Oct 25 '13 at 18:53