Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
PNChart
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
张航
2014-05-05 16:18:47 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
89d93300e75f97c3d913c95422fc896c072c0774
89d93300
1 parent
56351182
fix typo
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
PNChart/PNPieChart/PNPieChart.h
PNChart/PNPieChart/PNPieChart.m
PNChart/PNPieChart/PNPieChart.h
View file @
89d9330
...
...
@@ -15,11 +15,11 @@
@property
(
nonatomic
,
readonly
)
NSArray
*
items
;
@property
(
nonatomic
)
UIFont
*
descriptionTextFont
;
//def
ua
lt is [UIFont fontWithName:@"Avenir-Medium" size:18.0];
@property
(
nonatomic
)
UIColor
*
descriptionTextColor
;
//def
ua
lt is [UIColor whiteColor]
@property
(
nonatomic
)
UIColor
*
descriptionTextShadowColor
;
//def
ua
lt is [[UIColor blackColor] colorWithAlphaComponent:0.4]
@property
(
nonatomic
)
CGSize
descriptionTextShadowOffset
;
//def
ua
lt is CGSizeMake(0, 1)
@property
(
nonatomic
)
NSTimeInterval
duration
;
//def
ua
lt is 1.0
@property
(
nonatomic
)
UIFont
*
descriptionTextFont
;
//def
au
lt is [UIFont fontWithName:@"Avenir-Medium" size:18.0];
@property
(
nonatomic
)
UIColor
*
descriptionTextColor
;
//def
au
lt is [UIColor whiteColor]
@property
(
nonatomic
)
UIColor
*
descriptionTextShadowColor
;
//def
au
lt is [[UIColor blackColor] colorWithAlphaComponent:0.4]
@property
(
nonatomic
)
CGSize
descriptionTextShadowOffset
;
//def
au
lt is CGSizeMake(0, 1)
@property
(
nonatomic
)
NSTimeInterval
duration
;
//def
au
lt is 1.0
-
(
void
)
strokeChart
;
...
...
PNChart/PNPieChart/PNPieChart.m
View file @
89d9330
...
...
@@ -21,6 +21,8 @@
@property
(
nonatomic
)
CAShapeLayer
*
pieLayer
;
@property
(
nonatomic
)
NSMutableArray
*
descriptionLabels
;
-
(
void
)
loadDefault
;
-
(
UILabel
*
)
descriptionLabelForItemAtIndex
:(
NSUInteger
)
index
;
-
(
PNPieChartDataItem
*
)
dataItemForIndex
:(
NSUInteger
)
index
;
...
...
@@ -31,6 +33,7 @@
startPercentage
:(
CGFloat
)
startPercentage
endPercentage
:(
CGFloat
)
endPercentage
;
@end
...
...
@@ -49,14 +52,14 @@
_descriptionTextShadowOffset
=
CGSizeMake
(
0
,
1
);
_duration
=
1
.
0
;
[
self
loadDef
ua
lt
];
[
self
loadDef
au
lt
];
}
return
self
;
}
-
(
void
)
loadDef
ua
lt
{
-
(
void
)
loadDef
au
lt
{
_currentTotal
=
0
;
_total
=
0
;
...
...
@@ -73,7 +76,7 @@
#pragma mark -
-
(
void
)
strokeChart
{
[
self
loadDef
ua
lt
];
[
self
loadDef
au
lt
];
[
self
.
items
enumerateObjectsUsingBlock
:
^
(
id
obj
,
NSUInteger
idx
,
BOOL
*
stop
)
{
_total
+=
((
PNPieChartDataItem
*
)
obj
).
value
;
...
...
Please
register
or
login
to post a comment