Donut Chart with fixed datapoint and flavour color


#1

Hi, all.

I have found that shinobi chart (donut) can be add custom flavour color for each section.

The problem is:

  1. How to fix the flavour color and datapoint together such as datapoint named “account 1” always use red color.

  2. Can I ordering datapoint sequence as “account 1”, “account 2”, and so on. The current situation is the datapoint sequence is random as “account 3”, “account 5”, “account 2”, and so on.

Thank you for any help.


#2

Hi Chajang,

You should be able to set the colours of a pie chart by setting the setFlavourColors property on the SChartPieSeriesStyle of the SChartPieSeries of a pie chart. 

If know what order to expect your data points then you can simply create an NSArray of UIColors in a certain order and they will be applied to the correct slice. 

However we don’t offer functionality for ordering datapoint sequences out of the box. This is something you will have to do yourself before you pass the points to the chart. How you should do this depends on the implementation of your datasource. If you could provide me with more information about your datasource I would be more than willing to give you a more detail explanation of how to go about reordering the elements inside it.

Kind regards,

Daniel Allsop