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
mobileflowllc
2014-04-22 12:36:38 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d10c841f2c029f339194c0683ce04b4927365dd4
d10c841f
1 parent
c021d6fe
Updated circle chart API
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
PNChart/PNCircleChart.h
PNChart/PNCircleChart.m
PNChartDemo/PCChartsTableViewController.m
PNChart/PNCircleChart.h
View file @
d10c841
...
...
@@ -15,7 +15,7 @@
@interface
PNCircleChart
:
UIView
-
(
void
)
strokeChart
;
-
(
id
)
initWithFrame
:(
CGRect
)
frame
andTotal
:(
NSNumber
*
)
total
andCurrent
:(
NSNumber
*
)
current
andClockwise
:(
BOOL
)
clockwise
;
-
(
id
)
initWithFrame
:(
CGRect
)
frame
andTotal
:(
NSNumber
*
)
total
andCurrent
:(
NSNumber
*
)
current
andClockwise
:(
BOOL
)
clockwise
andShadow
:(
BOOL
)
hasBackgroundShadow
;
@property
(
nonatomic
)
UIColor
*
strokeColor
;
@property
(
nonatomic
)
UIColor
*
labelColor
;
...
...
PNChart/PNCircleChart.m
View file @
d10c841
...
...
@@ -27,7 +27,7 @@
}
-
(
id
)
initWithFrame
:
(
CGRect
)
frame
andTotal
:
(
NSNumber
*
)
total
andCurrent
:
(
NSNumber
*
)
current
andClockwise
:
(
BOOL
)
clockwise
-
(
id
)
initWithFrame
:
(
CGRect
)
frame
andTotal
:
(
NSNumber
*
)
total
andCurrent
:
(
NSNumber
*
)
current
andClockwise
:
(
BOOL
)
clockwise
andShadow
:
(
BOOL
)
hasBackgroundShadow
{
self
=
[
super
initWithFrame
:
frame
];
...
...
@@ -55,7 +55,7 @@
_circleBG
.
lineCap
=
kCALineCapRound
;
_circleBG
.
fillColor
=
[
UIColor
clearColor
].
CGColor
;
_circleBG
.
lineWidth
=
[
_lineWidth
floatValue
];
_circleBG
.
strokeColor
=
PNLightYellow
.
CGColor
;
_circleBG
.
strokeColor
=
(
hasBackgroundShadow
?
PNLightYellow
.
CGColor
:
[
UIColor
clearColor
].
CGColor
)
;
_circleBG
.
strokeEnd
=
1
.
0
;
_circleBG
.
zPosition
=
-
1
;
...
...
PNChartDemo/PCChartsTableViewController.m
View file @
d10c841
...
...
@@ -129,12 +129,18 @@
circleChartLabel
.
font
=
[
UIFont
fontWithName
:
@"Avenir-Medium"
size
:
23
.
0
];
circleChartLabel
.
textAlignment
=
NSTextAlignmentCenter
;
PNCircleChart
*
circleChart
=
[[
PNCircleChart
alloc
]
initWithFrame
:
CGRectMake
(
0
,
80
.
0
,
SCREEN_WIDTH
,
100
.
0
)
andTotal
:[
NSNumber
numberWithInt
:
100
]
andCurrent
:
[
NSNumber
numberWithInt
:
60
]
andClockwise
:
NO
];
PNCircleChart
*
circleChart
=
[[
PNCircleChart
alloc
]
initWithFrame
:
CGRectMake
(
0
,
80
.
0
,
SCREEN_WIDTH
,
100
.
0
)
andTotal
:[
NSNumber
numberWithInt
:
100
]
andCurrent
:
[
NSNumber
numberWithInt
:
60
]
andClockwise
:
YES
andShadow
:
NO
];
circleChart
.
backgroundColor
=
[
UIColor
clearColor
];
[
circleChart
setStrokeColor
:
PNGreen
];
[
circleChart
strokeChart
];
PNCircleChart
*
circleChart2
=
[[
PNCircleChart
alloc
]
initWithFrame
:
CGRectMake
(
0
,
80
.
0
,
SCREEN_WIDTH
,
100
.
0
)
andTotal
:[
NSNumber
numberWithInt
:
100
]
andCurrent
:
[
NSNumber
numberWithInt
:
90
]
andClockwise
:
YES
andShadow
:
YES
];
circleChart2
.
backgroundColor
=
[
UIColor
clearColor
];
[
circleChart2
setStrokeColor
:
PNBlue
];
[
circleChart2
strokeChart
];
[
viewController
.
view
addSubview
:
circleChartLabel
];
[
viewController
.
view
addSubview
:
circleChart2
];
[
viewController
.
view
addSubview
:
circleChart
];
viewController
.
title
=
@"Circle Chart"
;
...
...
Please
register
or
login
to post a comment