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-04-26 15:12:40 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
493e2b6d9d1b0abb372cc22f37879373012db22a
493e2b6d
2 parents
c021d6fe
d5af8435
Merge pull request #50 from moflo/master
Updated circle chart API
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
PNChart.podspec
PNChart/PNCircleChart.h
PNChart/PNCircleChart.m
PNChartDemo/PCChartsTableViewController.m
PNChart.podspec
View file @
493e2b6
...
...
@@ -3,7 +3,7 @@ Pod::Spec.new do |s|
s
.
version
=
"0.2.2"
s
.
summary
=
"A simple and beautiful chart lib with animation used in Piner for iOS"
s
.
homepage
=
"https://github.com/
kevinzhow
/PNChart"
s
.
homepage
=
"https://github.com/
moflo
/PNChart"
s
.
screenshots
=
"https://github-camo.global.ssl.fastly.net/ea8565b7a726409d5966ff4bcb8c4b9981fb33d3/687474703a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f313539393636322f706e63686172742e706e67"
s
.
license
=
{
:type
=>
'MIT'
,
:file
=>
'LICENSE'
}
...
...
@@ -11,12 +11,12 @@ Pod::Spec.new do |s|
s
.
author
=
{
"Kevin"
=>
"kevinchou.c@gmail.com"
}
s
.
platform
=
:ios
,
'6.0'
s
.
source
=
{
:git
=>
"https://github.com/
kevinzhow/PNChart.git"
,
:tag
=>
s
.
version
.
to_s
}
s
.
source
=
{
:git
=>
"https://github.com/
moflo/PNChart.git"
}
s
.
ios
.
dependency
'UICountingLabel'
,
'~> 1.0.0'
s
.
source_files
=
'PNChart
Demo/PNChart/**
/*.{h,m}'
s
.
public_header_files
=
'PNChart
Demo/PNChart/**
/*.h'
s
.
source_files
=
'PNChart/*.{h,m}'
s
.
public_header_files
=
'PNChart/*.h'
s
.
frameworks
=
'CoreGraphics'
,
'UIKit'
,
'Foundation'
,
'QuartzCore'
s
.
requires_arc
=
true
end
...
...
PNChart/PNCircleChart.h
View file @
493e2b6
...
...
@@ -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 @
493e2b6
...
...
@@ -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 @
493e2b6
...
...
@@ -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