In my app i have some special scenario which i am not able to handle.
I am getting data from Xml which i am putting in two Arrays Label and numProjects.
Label contains labels and numProjects contains values for respective labels.
With these values i need to draw a pie chart with different colors for each label.
The way i am drawing the chart is i put the data with which i need to populate the chart in one array and in other array i put colors which i need for different sections.
So here’s the problem with code:
labelArray = [Active, pipeline, closed];
numProjectArray = [248, 438,200];// respective values as per the labelArray
Now while drawing i need this numProjectArray and also i need to create another array which has all the colors i want to color the separate sections. Also there should be a specific pair for each of label-value-color. For each label there should be a unique value which is stored in numProjectArray and for this label-value pair we need a specific color to draw the section. And also need to display this information on side of graph that which color denotes which label.
Please help!!!
If you’re asking how to do this better, you should probably be thinking about something like an array of dictionaries, with one dictionary per label/value/color. Each dictionary would have keys like @”label”, @”numProjects”, and @”color”, and corresponding values.