Created
September 21, 2010 16:44
-
-
Save primalmotion/590008 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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