Skip to content

Instantly share code, notes, and snippets.

@primalmotion
Created September 21, 2010 16:44
Show Gist options
  • Select an option

  • Save primalmotion/590008 to your computer and use it in GitHub Desktop.

Select an option

Save primalmotion/590008 to your computer and use it in GitHub Desktop.
init
_chartViewDisk = [[LPPieChartView alloc] initWithFrame:diskViewFrame];
[_chartViewDisk setDrawView:[[TNPieChartDrawView alloc] init]];
[viewGraphDisk addSubview:_chartViewDisk];
subclass
@implementation TNPieChartDrawView : LPPieChartDrawView
- (void)drawInContext:(CGContext)context paths:(CPArray)paths
{
/*
Overwrite this method in your subclass.
*/
CGContextSetLineWidth(context, 1.0);
CGContextSetStrokeColor(context, [CPColor whiteColor]);
var fillColors = [[CPColor grayColor], [CPColor blueColor]];
for (var i = 0; i < paths.length; i++)
{
CGContextBeginPath(context);
CGContextAddPath(context, paths[i]);
CGContextClosePath(context);
CGContextSetFillColor(context, fillColors[i]);
CGContextFillPath(context);
CGContextStrokePath(context);
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment