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
kevinzhow
2013-12-01 16:01:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0a937f41ca670e015cc18030baf7bb66ffd93d1c
0a937f41
1 parent
a5a9fbf5
Circle Chart response to the View Height
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
PNChartDemo/PCChartsTableViewController.m
PNChartDemo/PNChart/PNCircleChart.m
PNChartDemo/PCChartsTableViewController.m
View file @
0a937f4
...
...
@@ -102,7 +102,7 @@
circleChartLabel
.
font
=
[
UIFont
fontWithName
:
@"Avenir-Medium"
size
:
23
.
0
];
circleChartLabel
.
textAlignment
=
NSTextAlignmentCenter
;
PNChart
*
circleChart
=
[[
PNChart
alloc
]
initWithFrame
:
CGRectMake
(
0
,
135
.
0
,
SCREEN_WIDTH
,
2
00
.
0
)];
PNChart
*
circleChart
=
[[
PNChart
alloc
]
initWithFrame
:
CGRectMake
(
0
,
135
.
0
,
SCREEN_WIDTH
,
1
00
.
0
)];
circleChart
.
backgroundColor
=
[
UIColor
clearColor
];
circleChart
.
type
=
PNCircleType
;
circleChart
.
total
=
[
NSNumber
numberWithInt
:
100
];
...
...
PNChartDemo/PNChart/PNCircleChart.m
View file @
0a937f4
...
...
@@ -20,9 +20,7 @@
_total
=
total
;
_current
=
current
;
NSLog
(
@"Total is %f frame is %f"
,[
total
floatValue
],
frame
.
size
.
height
);
UIBezierPath
*
circlePath
=
[
UIBezierPath
bezierPathWithArcCenter
:
CGPointMake
(
self
.
center
.
x
,
self
.
center
.
y
-
25
.
0
)
radius
:
50
.
0
startAngle
:
DEGREES_TO_RADIANS
(
270
)
endAngle
:
DEGREES_TO_RADIANS
(
270
.
01
)
clockwise
:
NO
];
UIBezierPath
*
circlePath
=
[
UIBezierPath
bezierPathWithArcCenter
:
CGPointMake
(
self
.
center
.
x
,
self
.
center
.
y
)
radius
:
self
.
frame
.
size
.
height
*
0
.
5
startAngle
:
DEGREES_TO_RADIANS
(
270
)
endAngle
:
DEGREES_TO_RADIANS
(
270
.
01
)
clockwise
:
NO
];
_circle
=
[
CAShapeLayer
layer
];
_circle
.
path
=
circlePath
.
CGPath
;
...
...
@@ -57,7 +55,7 @@
[
gradeLabel
setTextAlignment
:
NSTextAlignmentCenter
];
[
gradeLabel
setFont
:[
UIFont
boldSystemFontOfSize
:
13
.
0
f
]];
[
gradeLabel
setTextColor
:
PNDeepGrey
];
[
gradeLabel
setCenter
:
CGPointMake
(
self
.
center
.
x
,
self
.
center
.
y
-
25
.
0
)];
[
gradeLabel
setCenter
:
CGPointMake
(
self
.
center
.
x
,
self
.
center
.
y
)];
gradeLabel
.
method
=
UILabelCountingMethodEaseInOut
;
gradeLabel
.
format
=
@"%d%%"
;
...
...
Please
register
or
login
to post a comment