Ask away

Pie Chart component for Dynamic values

Serrano 07/16/17 22:33

35 views

Question CategoryComponent

Number of completed projects0

Question StatusUnsolved

  • pie chart
  • component

Question

I am beginner in the nest component development. I am developing an application and I want to create pie chart component using dynamic data from JSON. Data will looks like: { "name": "Sales", "total_earning": "904006", "per": 40.41 }, { "name": "Service", "total_earning": "596845", "per": 26.68 } I want display "per" in pie chart and it's dynamic values. Can you tell me which is the best way?

Answers

4
Lpg Greetings 07/17/17 19:39

u can use dlpiechart class of dilipajm in GitHub, then, modify property & var for your purpose. Hope its useful.

Jacob 07/17/17 23:43

in DLPieChart.m file, find method - (CGFloat)pieChart:(DLPieChart *)pieChart valueForSliceAtIndex:(NSUInteger)index {} , then modify line below: return [[self.DLDataArray objectAtIndex:index] intValue]; to: return [[self.DLDataArray objectAtIndex:index] floatValue ]; Hope its helpful.

Jeffrey 07/18/17 10:29

improve your formatting

Arness 07/18/17 11:03

in DLPieChart.m, find method - (void)updateLabelForLayer:(SliceLayer *)pieLayer value:(CGFloat)value {} , then change: @"%0.0f" to: @"%.2f". Hope its useful.

Answer

Project

Image

Comment