I’m trying to toggle the fill for a Core Plot plot area on and off. When I set up the fill at application launch everything works. Toggling the first time works fine. Subsequent toggling of the fill on or off does not work unless a rotate the display.
-(void)layoutGraphPlotAreaFill{
CPTFill *plotFill=nil;
if (self.graphPlotAreaHasFill) {
plotFill=self.graphPlotAreaFill;
}else{
plotFill=nil;
}
self.graph.plotAreaFrame.plotArea.fill=plotFill;
}
I’m calling the above code from a settings view controller via a delegate method. NSLog statements within the above method (removed) show that the method is being called, that the graphPlotAreaHasFill property is set correctly and the CPTFill is correct. It just isn’t updating the plotArea fill. Again, it will only update after rotating the display.
Using Core Plot 1.0.
Any suggestions on how to force the update of the fill area without having to rotate?
Thanks
found the answer here: Calling setNeedsDisplay:YES on layer-hosting view does not redraw the view
turns out because the fill is a
CALayersubclass, I can callsetNeedsDisplayand it will refresh. Update code is as follows: