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
Kevin
2014-01-14 01:45:45 -0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
6a7b328b7214ce46d50bb84c7556641c9f933a16
6a7b328b
2 parents
6c1d9ea0
5618c52f
Merge pull request #28 from Lewuathe/update-circlechart
Continuous updating of PNCircleChart
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
PNChartDemo/PNChart/PNCircleChart.m
PNChartDemo/PNChart/PNCircleChart.m
View file @
6a7b328
...
...
@@ -9,6 +9,12 @@
#import "PNCircleChart.h"
#import "UICountingLabel.h"
@interface
PNCircleChart
()
{
UICountingLabel
*
_gradeLabel
;
}
@end
@implementation
PNCircleChart
...
...
@@ -42,6 +48,8 @@
[
self
.
layer
addSublayer
:
_circle
];
[
self
.
layer
addSublayer
:
_circleBG
];
_gradeLabel
=
[[
UICountingLabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
50
.
0
,
50
.
0
)];
}
...
...
@@ -53,16 +61,15 @@
{
//Add count label
UICountingLabel
*
gradeLabel
=
[[
UICountingLabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
50
.
0
,
50
.
0
)];
[
gradeLabel
setTextAlignment
:
NSTextAlignmentCenter
];
[
gradeLabel
setFont
:[
UIFont
boldSystemFontOfSize
:
13
.
0
f
]];
[
gradeLabel
setTextColor
:
PNDeepGrey
];
[
gradeLabel
setCenter
:
CGPointMake
(
self
.
center
.
x
,
self
.
center
.
y
)];
gradeLabel
.
method
=
UILabelCountingMethodEaseInOut
;
gradeLabel
.
format
=
@"%d%%"
;
[
_gradeLabel
setTextAlignment
:
NSTextAlignmentCenter
];
[
_gradeLabel
setFont
:[
UIFont
boldSystemFontOfSize
:
13
.
0
f
]];
[
_gradeLabel
setTextColor
:
PNDeepGrey
];
[
_gradeLabel
setCenter
:
CGPointMake
(
self
.
center
.
x
,
self
.
center
.
y
)];
_gradeLabel
.
method
=
UILabelCountingMethodEaseInOut
;
_gradeLabel
.
format
=
@"%d%%"
;
[
self
addSubview
:
gradeLabel
];
[
self
addSubview
:
_
gradeLabel
];
//Add circle params
...
...
@@ -80,7 +87,7 @@
[
_circle
addAnimation
:
pathAnimation
forKey
:
@"strokeEndAnimation"
];
_circle
.
strokeEnd
=
[
_current
floatValue
]
/
[
_total
floatValue
];
[
gradeLabel
countFrom
:
0
to
:[
_current
floatValue
]
/
[
_total
floatValue
]
*
100
withDuration
:
1
.
0
];
[
_
gradeLabel
countFrom
:
0
to
:[
_current
floatValue
]
/
[
_total
floatValue
]
*
100
withDuration
:
1
.
0
];
}
...
...
Please
register
or
login
to post a comment