This is a migrated thread and some comments may be shown as answers.

Pie chart

1 Answer 25 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
License
Top achievements
Rank 1
License asked on 25 Oct 2016, 05:48 AM
Why pie chart the 9th's color is the same as the first one ?I want each of them is different from each other

1 Answer, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 27 Oct 2016, 01:20 PM
Hello,

The 9th color is the same like the first one because the chart's theme has 8 different colors and when you have more than 8 slices in the pie the colors start repeating again from the first one. You can provide a different color by implementing chart:paletteItemForSeries:atIndex method of TKChartDelegate. Using the index you can return a palette item with a different color for the corresponding slice. Consider the code below:
- (TKChartPaletteItem *)chart:(TKChart *)chart paletteItemForSeries:(TKChartSeries *)series atIndex:(NSInteger)index {
    if (index == 1) {
        return [TKChartPaletteItem paletteItemWithFill:[TKSolidFill solidFillWithColor:[UIColor redColor]]];
    }
     
    return nil;
}


Regards,
Adrian
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
License
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Share this question
or