gujjula / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Change color of a selected slice #246

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Using the -(void)pieChart:(CPPieChart*)plot 
sliceWasSelectedAtRecordIndex:(NSUInteger)index{}

What is the expected output? What do you see instead?
I would like to change the color of a slice when I click on it (so only for the 
slice I selected). I didn't find anything so is it possible ? How ?

What version of the product are you using? On what operating system?
Last version of the product, with iPad emulator (last version too).

Please provide any additional information below.
The function ...sliceWasSelectedAtRecordIndex:... works fine : I can detect 
when I click on a slice but I don't know how to change the color (as I 
explained above)

Thank you for help

Original issue reported on code.google.com by maxdiver...@gmail.com on 18 Jan 2011 at 4:40

GoogleCodeExporter commented 9 years ago
You control the color of the slices with the -sliceFillForPieChart:recordIndex: 
datasource method. When you detect a click on a slice, call 
-reloadDataInIndexRange: for the index clicked and return the new fill from the 
datasource. You also may need to reload the previously selected index to clear 
a previous selection.

Original comment by eskr...@mac.com on 19 Jan 2011 at 2:59

GoogleCodeExporter commented 9 years ago

Original comment by eskr...@mac.com on 19 Jan 2011 at 2:59