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-08-06 04:37:12 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
fbd86a1df9d47685bb43305894c39ad56c1b898e
fbd86a1d
2 parents
bdc11d5a
836750d1
Merge pull request #83 from moflo/master
Add gradient option to bar & circle charts
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
180 additions
and
96 deletions
PNChart.podspec
PNChart/PNBarChart/PNBar.h → PNChart/PNBar.h
PNChart/PNBarChart/PNBar.m → PNChart/PNBar.m
PNChart/PNBarChart/PNBarChart.h → PNChart/PNBarChart.h
PNChart/PNBarChart/PNBarChart.m → PNChart/PNBarChart.m
PNChart/PNCircleChart/PNCircleChart.h → PNChart/PNCircleChart.h
PNChart/PNCircleChart/PNCircleChart.m → PNChart/PNCircleChart.m
PNChart/PNLineChart/PNLineChart.h → PNChart/PNLineChart.h
PNChart/PNLineChart/PNLineChart.m → PNChart/PNLineChart.m
PNChart/PNLineChart/PNLineChartData.h → PNChart/PNLineChartData.h
PNChart/PNLineChart/PNLineChartData.m → PNChart/PNLineChartData.m
PNChart/PNLineChart/PNLineChartDataItem.h → PNChart/PNLineChartDataItem.h
PNChart/PNLineChart/PNLineChartDataItem.m → PNChart/PNLineChartDataItem.m
PNChart/PNPieChart/PNPieChart.h → PNChart/PNPieChart.h
PNChart/PNPieChart/PNPieChart.m → PNChart/PNPieChart.m
PNChart/PNPieChart/PNPieChartDataItem.h → PNChart/PNPieChartDataItem.h
PNChart/PNPieChart/PNPieChartDataItem.m → PNChart/PNPieChartDataItem.m
PNChartDemo.xcodeproj/project.pbxproj
PNChartDemo/PCChartsTableViewController.m
Podfile.lock
PNChart.podspec
View file @
fbd86a1
...
...
@@ -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"
}
s
.
source
=
{
:git
=>
"https://github.com/
moflo
/PNChart.git"
}
s
.
ios
.
dependency
'UICountingLabel'
,
'~> 1.0.0'
s
.
source_files
=
'PNChart/*.{h,m}'
s
.
public_header_files
=
'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/PNBar
Chart/PNBar
.h
→
PNChart/PNBar.h
View file @
fbd86a1
...
...
@@ -16,6 +16,7 @@
@property
(
nonatomic
)
float
grade
;
@property
(
nonatomic
)
CAShapeLayer
*
chartLine
;
@property
(
nonatomic
)
UIColor
*
barColor
;
@property
(
nonatomic
)
UIColor
*
barColorGradientStart
;
@property
(
nonatomic
)
CGFloat
barRadius
;
@end
...
...
PNChart/PNBar
Chart/PNBar
.m
→
PNChart/PNBar.m
View file @
fbd86a1
...
...
@@ -64,6 +64,39 @@
[
_chartLine
addAnimation
:
pathAnimation
forKey
:
@"strokeEndAnimation"
];
_chartLine
.
strokeEnd
=
1
.
0
;
// Check if user wants to add a gradient from the start color to the bar color
if
(
_barColorGradientStart
)
{
// Add gradient
CAShapeLayer
*
gradientMask
=
[
CAShapeLayer
layer
];
gradientMask
.
fillColor
=
[[
UIColor
clearColor
]
CGColor
];
gradientMask
.
strokeColor
=
[[
UIColor
blackColor
]
CGColor
];
//gradientMask.lineWidth = 4;
gradientMask
.
lineWidth
=
self
.
frame
.
size
.
width
;
gradientMask
.
frame
=
CGRectMake
(
0
,
0
,
self
.
bounds
.
size
.
width
,
self
.
bounds
.
size
.
height
);
gradientMask
.
path
=
progressline
.
CGPath
;
CAGradientLayer
*
gradientLayer
=
[
CAGradientLayer
layer
];
gradientLayer
.
startPoint
=
CGPointMake
(
0
.
5
,
1
.
0
);
gradientLayer
.
endPoint
=
CGPointMake
(
0
.
5
,
0
.
0
);
gradientLayer
.
frame
=
CGRectMake
(
0
,
0
,
self
.
bounds
.
size
.
width
,
self
.
bounds
.
size
.
height
);
UIColor
*
endColor
=
(
_barColor
?
_barColor
:
[
UIColor
greenColor
]);
NSArray
*
colors
=
@[
(
id
)
_barColorGradientStart
.
CGColor
,
(
id
)
endColor
.
CGColor
];
gradientLayer
.
colors
=
colors
;
[
gradientLayer
setMask
:
gradientMask
];
[
_chartLine
addSublayer
:
gradientLayer
];
gradientMask
.
strokeEnd
=
1
.
0
;
[
gradientMask
addAnimation
:
pathAnimation
forKey
:
@"strokeEndAnimation"
];
}
}
...
...
@@ -74,6 +107,17 @@
}
completion
:
nil
];
}
-
(
void
)
setBarColorGradientStart
:
(
UIColor
*
)
barColorGradientStart
{
// Set gradient color, remove any existing sublayer first
for
(
CALayer
*
sublayer
in
[
_chartLine
sublayers
])
{
[
sublayer
removeFromSuperlayer
];
}
_barColorGradientStart
=
barColorGradientStart
;
[
self
setGrade
:
_grade
];
}
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
...
...
PNChart/PNBarChart
/PNBarChart
.h
→
PNChart/PNBarChart.h
View file @
fbd86a1
...
...
@@ -123,6 +123,12 @@ typedef NSString *(^PNyLabelFromatter)(CGFloat yLabelValue);
*/
@property
(
nonatomic
)
CGFloat
yMinValue
;
/*
switch to indicate that the bar should be filled as a gradient
*/
@property
(
nonatomic
)
UIColor
*
barColorGradientStart
;
@property
(
nonatomic
,
retain
)
id
<
PNChartDelegate
>
delegate
;
@end
...
...
PNChart/PNBarChart
/PNBarChart
.m
→
PNChart/PNBarChart.m
View file @
fbd86a1
...
...
@@ -205,9 +205,14 @@
//Height Of Bar
bar
.
grade
=
grade
;
// Add gradient
bar
.
barColorGradientStart
=
_barColorGradientStart
;
//For Click Index
bar
.
tag
=
index
;
[
_bars
addObject
:
bar
];
[
self
addSubview
:
bar
];
...
...
PNChart/PNCircleChart
/PNCircleChart
.h
→
PNChart/PNCircleChart.h
View file @
fbd86a1
...
...
@@ -26,6 +26,7 @@ typedef NS_ENUM(NSUInteger, PNChartFormatType) {
@property
(
strong
,
nonatomic
)
UICountingLabel
*
countingLabel
;
@property
(
nonatomic
)
UIColor
*
strokeColor
;
@property
(
nonatomic
)
UIColor
*
strokeColorGradientStart
;
@property
(
nonatomic
)
NSNumber
*
total
;
@property
(
nonatomic
)
NSNumber
*
current
;
@property
(
nonatomic
)
NSNumber
*
lineWidth
;
...
...
PNChart/PNCircleChart
/PNCircleChart
.m
→
PNChart/PNCircleChart.m
View file @
fbd86a1
...
...
@@ -101,6 +101,41 @@
_circle
.
strokeEnd
=
[
_current
floatValue
]
/
[
_total
floatValue
];
[
_countingLabel
countFrom
:
0
to
:[
_current
floatValue
]
withDuration
:
1
.
0
];
// Check if user wants to add a gradient from the start color to the bar color
if
(
_strokeColorGradientStart
)
{
// Add gradient
CAShapeLayer
*
gradientMask
=
[
CAShapeLayer
layer
];
gradientMask
.
fillColor
=
[[
UIColor
clearColor
]
CGColor
];
gradientMask
.
strokeColor
=
[[
UIColor
blackColor
]
CGColor
];
gradientMask
.
lineWidth
=
_circle
.
lineWidth
;
gradientMask
.
lineCap
=
kCALineCapRound
;
CGRect
gradientFrame
=
CGRectMake
(
0
,
0
,
2
*
self
.
bounds
.
size
.
width
,
2
*
self
.
bounds
.
size
.
height
);
gradientMask
.
frame
=
gradientFrame
;
gradientMask
.
path
=
_circle
.
path
;
CAGradientLayer
*
gradientLayer
=
[
CAGradientLayer
layer
];
gradientLayer
.
startPoint
=
CGPointMake
(
0
.
5
,
1
.
0
);
gradientLayer
.
endPoint
=
CGPointMake
(
0
.
5
,
0
.
0
);
gradientLayer
.
frame
=
gradientFrame
;
UIColor
*
endColor
=
(
_strokeColor
?
_strokeColor
:
[
UIColor
greenColor
]);
NSArray
*
colors
=
@[
(
id
)
endColor
.
CGColor
,
(
id
)
_strokeColorGradientStart
.
CGColor
];
gradientLayer
.
colors
=
colors
;
[
gradientLayer
setMask
:
gradientMask
];
[
_circle
addSublayer
:
gradientLayer
];
gradientMask
.
strokeEnd
=
[
_current
floatValue
]
/
[
_total
floatValue
];
[
gradientMask
addAnimation
:
pathAnimation
forKey
:
@"strokeEndAnimation"
];
}
}
...
...
PNChart/PNLineChart
/PNLineChart
.h
→
PNChart/PNLineChart.h
View file @
fbd86a1
File moved
PNChart/PNLineChart
/PNLineChart
.m
→
PNChart/PNLineChart.m
View file @
fbd86a1
...
...
@@ -67,18 +67,20 @@
CGFloat
yStep
=
(
_yValueMax
-
_yValueMin
)
/
_yLabelNum
;
CGFloat
yStepHeight
=
_chartCavanHeight
/
_yLabelNum
;
if
(
_showLabel
)
{
NSInteger
index
=
0
;
NSInteger
num
=
_yLabelNum
+
1
;
NSInteger
index
=
0
;
NSInteger
num
=
_yLabelNum
+
1
;
while
(
num
>
0
)
{
PNChartLabel
*
label
=
[[
PNChartLabel
alloc
]
initWithFrame
:
CGRectMake
(
0
.
0
,
(
_chartCavanHeight
-
index
*
yStepHeight
),
_chartMargin
,
_yLabelHeight
)];
[
label
setTextAlignment
:
NSTextAlignmentRight
];
NSString
*
yLabelFormat
=
self
.
yLabelFormat
?
self
.
yLabelFormat
:
@"%1.f"
;
label
.
text
=
[
NSString
stringWithFormat
:
yLabelFormat
,
_yValueMin
+
(
yStep
*
index
)];
[
self
addSubview
:
label
];
index
+=
1
;
num
-=
1
;
while
(
num
>
0
)
{
PNChartLabel
*
label
=
[[
PNChartLabel
alloc
]
initWithFrame
:
CGRectMake
(
0
.
0
,
(
_chartCavanHeight
-
index
*
yStepHeight
),
_chartMargin
,
_yLabelHeight
)];
[
label
setTextAlignment
:
NSTextAlignmentRight
];
NSString
*
yLabelFormat
=
self
.
yLabelFormat
?
self
.
yLabelFormat
:
@"%1.f"
;
label
.
text
=
[
NSString
stringWithFormat
:
yLabelFormat
,
_yValueMin
+
(
yStep
*
index
)];
[
self
addSubview
:
label
];
index
+=
1
;
num
-=
1
;
}
}
}
...
...
PNChart/PNLineChart
/PNLineChart
Data.h
→
PNChart/PNLineChartData.h
View file @
fbd86a1
File moved
PNChart/PNLineChart
/PNLineChart
Data.m
→
PNChart/PNLineChartData.m
View file @
fbd86a1
File moved
PNChart/PNLineChart
/PNLineChart
DataItem.h
→
PNChart/PNLineChartDataItem.h
View file @
fbd86a1
File moved
PNChart/PNLineChart
/PNLineChart
DataItem.m
→
PNChart/PNLineChartDataItem.m
View file @
fbd86a1
File moved
PNChart/PNPieChart
/PNPieChart
.h
→
PNChart/PNPieChart.h
View file @
fbd86a1
File moved
PNChart/PNPieChart
/PNPieChart
.m
→
PNChart/PNPieChart.m
View file @
fbd86a1
File moved
PNChart/PNPieChart
/PNPieChart
DataItem.h
→
PNChart/PNPieChartDataItem.h
View file @
fbd86a1
File moved
PNChart/PNPieChart
/PNPieChart
DataItem.m
→
PNChart/PNPieChartDataItem.m
View file @
fbd86a1
File moved
PNChartDemo.xcodeproj/project.pbxproj
View file @
fbd86a1
...
...
@@ -22,18 +22,26 @@
0AF7A891182AA9F6003645C4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0AF7A88F182AA9F6003645C4 /* InfoPlist.strings */; };
0AF7A893182AA9F6003645C4 /* PNChartDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AF7A892182AA9F6003645C4 /* PNChartDemoTests.m */; };
0AF7A8AF182AAEEF003645C4 /* PCChartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AF7A8AE182AAEEF003645C4 /* PCChartViewController.m */; };
91177ED8198DFAC400017E27 /* PNBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177EC9198DFAC400017E27 /* PNBar.m */; };
91177ED9198DFAC400017E27 /* PNBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177EC9198DFAC400017E27 /* PNBar.m */; };
91177EDA198DFAC400017E27 /* PNBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ECB198DFAC400017E27 /* PNBarChart.m */; };
91177EDB198DFAC400017E27 /* PNBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ECB198DFAC400017E27 /* PNBarChart.m */; };
91177EDC198DFAC400017E27 /* PNCircleChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ECD198DFAC400017E27 /* PNCircleChart.m */; };
91177EDD198DFAC400017E27 /* PNCircleChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ECD198DFAC400017E27 /* PNCircleChart.m */; };
91177EDE198DFAC400017E27 /* PNLineChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ECF198DFAC400017E27 /* PNLineChart.m */; };
91177EDF198DFAC400017E27 /* PNLineChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ECF198DFAC400017E27 /* PNLineChart.m */; };
91177EE0198DFAC400017E27 /* PNLineChartData.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ED1198DFAC400017E27 /* PNLineChartData.m */; };
91177EE1198DFAC400017E27 /* PNLineChartData.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ED1198DFAC400017E27 /* PNLineChartData.m */; };
91177EE2198DFAC400017E27 /* PNLineChartDataItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ED3198DFAC400017E27 /* PNLineChartDataItem.m */; };
91177EE3198DFAC400017E27 /* PNLineChartDataItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ED3198DFAC400017E27 /* PNLineChartDataItem.m */; };
91177EE4198DFAC400017E27 /* PNPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ED5198DFAC400017E27 /* PNPieChart.m */; };
91177EE5198DFAC400017E27 /* PNPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ED5198DFAC400017E27 /* PNPieChart.m */; };
91177EE6198DFAC400017E27 /* PNPieChartDataItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ED7198DFAC400017E27 /* PNPieChartDataItem.m */; };
91177EE7198DFAC400017E27 /* PNPieChartDataItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 91177ED7198DFAC400017E27 /* PNPieChartDataItem.m */; };
9FA23B10184A5944002DBBA4 /* PCChartsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FA23B0F184A5944002DBBA4 /* PCChartsTableViewController.m */; };
9FE15DF6190BB014004129F5 /* PNBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FE15DE3190BB014004129F5 /* PNBar.m */; };
9FE15DF7190BB014004129F5 /* PNBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FE15DE5190BB014004129F5 /* PNBarChart.m */; };
9FE15DF8190BB014004129F5 /* PNChartLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FE15DE9190BB014004129F5 /* PNChartLabel.m */; };
9FE15DF9190BB014004129F5 /* PNCircleChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FE15DEC190BB014004129F5 /* PNCircleChart.m */; };
9FE15DFA190BB014004129F5 /* PNColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FE15DEE190BB014004129F5 /* PNColor.m */; };
9FE15DFB190BB014004129F5 /* PNLineChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FE15DF1190BB014004129F5 /* PNLineChart.m */; };
9FE15DFC190BB014004129F5 /* PNLineChartData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FE15DF3190BB014004129F5 /* PNLineChartData.m */; };
9FE15DFD190BB014004129F5 /* PNLineChartDataItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FE15DF5190BB014004129F5 /* PNLineChartDataItem.m */; };
E2C3ED5773A1409C8367CC70 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BA6321352024B1FBA0158B0 /* libPods.a */; };
F938F7E11917727E00B4448E /* PNPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = F938F7E01917727E00B4448E /* PNPieChart.m */; };
F938F7E4191772F200B4448E /* PNPieChartDataItem.m in Sources */ = {isa = PBXBuildFile; fileRef = F938F7E3191772F200B4448E /* PNPieChartDataItem.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
...
...
@@ -68,31 +76,31 @@
0AF7A8AD182AAEEF003645C4 /* PCChartViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PCChartViewController.h; sourceTree = "<group>"; };
0AF7A8AE182AAEEF003645C4 /* PCChartViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PCChartViewController.m; sourceTree = "<group>"; };
3BA6321352024B1FBA0158B0 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
91177EC8198DFAC400017E27 /* PNBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNBar.h; sourceTree = "<group>"; };
91177EC9198DFAC400017E27 /* PNBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNBar.m; sourceTree = "<group>"; };
91177ECA198DFAC400017E27 /* PNBarChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNBarChart.h; sourceTree = "<group>"; };
91177ECB198DFAC400017E27 /* PNBarChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNBarChart.m; sourceTree = "<group>"; };
91177ECC198DFAC400017E27 /* PNCircleChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNCircleChart.h; sourceTree = "<group>"; };
91177ECD198DFAC400017E27 /* PNCircleChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNCircleChart.m; sourceTree = "<group>"; };
91177ECE198DFAC400017E27 /* PNLineChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNLineChart.h; sourceTree = "<group>"; };
91177ECF198DFAC400017E27 /* PNLineChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNLineChart.m; sourceTree = "<group>"; };
91177ED0198DFAC400017E27 /* PNLineChartData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNLineChartData.h; sourceTree = "<group>"; };
91177ED1198DFAC400017E27 /* PNLineChartData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNLineChartData.m; sourceTree = "<group>"; };
91177ED2198DFAC400017E27 /* PNLineChartDataItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNLineChartDataItem.h; sourceTree = "<group>"; };
91177ED3198DFAC400017E27 /* PNLineChartDataItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNLineChartDataItem.m; sourceTree = "<group>"; };
91177ED4198DFAC400017E27 /* PNPieChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNPieChart.h; sourceTree = "<group>"; };
91177ED5198DFAC400017E27 /* PNPieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNPieChart.m; sourceTree = "<group>"; };
91177ED6198DFAC400017E27 /* PNPieChartDataItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNPieChartDataItem.h; sourceTree = "<group>"; };
91177ED7198DFAC400017E27 /* PNPieChartDataItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNPieChartDataItem.m; sourceTree = "<group>"; };
9FA23B0E184A5944002DBBA4 /* PCChartsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PCChartsTableViewController.h; sourceTree = "<group>"; };
9FA23B0F184A5944002DBBA4 /* PCChartsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PCChartsTableViewController.m; sourceTree = "<group>"; };
9FE15DE2190BB014004129F5 /* PNBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNBar.h; sourceTree = "<group>"; };
9FE15DE3190BB014004129F5 /* PNBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNBar.m; sourceTree = "<group>"; };
9FE15DE4190BB014004129F5 /* PNBarChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNBarChart.h; sourceTree = "<group>"; };
9FE15DE5190BB014004129F5 /* PNBarChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNBarChart.m; sourceTree = "<group>"; };
9FE15DE6190BB014004129F5 /* PNChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNChart.h; sourceTree = "<group>"; };
9FE15DE7190BB014004129F5 /* PNChartDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNChartDelegate.h; sourceTree = "<group>"; };
9FE15DE8190BB014004129F5 /* PNChartLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNChartLabel.h; sourceTree = "<group>"; };
9FE15DE9190BB014004129F5 /* PNChartLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNChartLabel.m; sourceTree = "<group>"; };
9FE15DEB190BB014004129F5 /* PNCircleChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNCircleChart.h; sourceTree = "<group>"; };
9FE15DEC190BB014004129F5 /* PNCircleChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNCircleChart.m; sourceTree = "<group>"; };
9FE15DED190BB014004129F5 /* PNColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNColor.h; sourceTree = "<group>"; };
9FE15DEE190BB014004129F5 /* PNColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNColor.m; sourceTree = "<group>"; };
9FE15DF0190BB014004129F5 /* PNLineChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNLineChart.h; sourceTree = "<group>"; };
9FE15DF1190BB014004129F5 /* PNLineChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNLineChart.m; sourceTree = "<group>"; };
9FE15DF2190BB014004129F5 /* PNLineChartData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNLineChartData.h; sourceTree = "<group>"; };
9FE15DF3190BB014004129F5 /* PNLineChartData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNLineChartData.m; sourceTree = "<group>"; };
9FE15DF4190BB014004129F5 /* PNLineChartDataItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNLineChartDataItem.h; sourceTree = "<group>"; };
9FE15DF5190BB014004129F5 /* PNLineChartDataItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNLineChartDataItem.m; sourceTree = "<group>"; };
F161CF4F7A8C4BD2AB65FB4F /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = "<group>"; };
F938F7DF1917727E00B4448E /* PNPieChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNPieChart.h; sourceTree = "<group>"; };
F938F7E01917727E00B4448E /* PNPieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNPieChart.m; sourceTree = "<group>"; };
F938F7E2191772F200B4448E /* PNPieChartDataItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PNPieChartDataItem.h; sourceTree = "<group>"; };
F938F7E3191772F200B4448E /* PNPieChartDataItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PNPieChartDataItem.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -211,64 +219,32 @@
9FE15DE0190BB014004129F5 /* PNChart */ = {
isa = PBXGroup;
children = (
F938F7DE191770FE00B4448E /* PNPieChart */,
9FE15DE1190BB014004129F5 /* PNBarChart */,
9FE15DE6190BB014004129F5 /* PNChart.h */,
9FE15DE7190BB014004129F5 /* PNChartDelegate.h */,
9FE15DE8190BB014004129F5 /* PNChartLabel.h */,
9FE15DE9190BB014004129F5 /* PNChartLabel.m */,
9FE15DEA190BB014004129F5 /* PNCircleChart */,
9FE15DED190BB014004129F5 /* PNColor.h */,
9FE15DEE190BB014004129F5 /* PNColor.m */,
9FE15DEF190BB014004129F5 /* PNLineChart */,
91177EC8198DFAC400017E27 /* PNBar.h */,
91177EC9198DFAC400017E27 /* PNBar.m */,
91177ECA198DFAC400017E27 /* PNBarChart.h */,
91177ECB198DFAC400017E27 /* PNBarChart.m */,
91177ECC198DFAC400017E27 /* PNCircleChart.h */,
91177ECD198DFAC400017E27 /* PNCircleChart.m */,
91177ECE198DFAC400017E27 /* PNLineChart.h */,
91177ECF198DFAC400017E27 /* PNLineChart.m */,
91177ED0198DFAC400017E27 /* PNLineChartData.h */,
91177ED1198DFAC400017E27 /* PNLineChartData.m */,
91177ED2198DFAC400017E27 /* PNLineChartDataItem.h */,
91177ED3198DFAC400017E27 /* PNLineChartDataItem.m */,
91177ED4198DFAC400017E27 /* PNPieChart.h */,
91177ED5198DFAC400017E27 /* PNPieChart.m */,
91177ED6198DFAC400017E27 /* PNPieChartDataItem.h */,
91177ED7198DFAC400017E27 /* PNPieChartDataItem.m */,
);
path = PNChart;
sourceTree = "<group>";
};
9FE15DE1190BB014004129F5 /* PNBarChart */ = {
isa = PBXGroup;
children = (
9FE15DE2190BB014004129F5 /* PNBar.h */,
9FE15DE3190BB014004129F5 /* PNBar.m */,
9FE15DE4190BB014004129F5 /* PNBarChart.h */,
9FE15DE5190BB014004129F5 /* PNBarChart.m */,
);
path = PNBarChart;
sourceTree = "<group>";
};
9FE15DEA190BB014004129F5 /* PNCircleChart */ = {
isa = PBXGroup;
children = (
9FE15DEB190BB014004129F5 /* PNCircleChart.h */,
9FE15DEC190BB014004129F5 /* PNCircleChart.m */,
);
path = PNCircleChart;
sourceTree = "<group>";
};
9FE15DEF190BB014004129F5 /* PNLineChart */ = {
isa = PBXGroup;
children = (
9FE15DF0190BB014004129F5 /* PNLineChart.h */,
9FE15DF1190BB014004129F5 /* PNLineChart.m */,
9FE15DF2190BB014004129F5 /* PNLineChartData.h */,
9FE15DF3190BB014004129F5 /* PNLineChartData.m */,
9FE15DF4190BB014004129F5 /* PNLineChartDataItem.h */,
9FE15DF5190BB014004129F5 /* PNLineChartDataItem.m */,
);
path = PNLineChart;
sourceTree = "<group>";
};
F938F7DE191770FE00B4448E /* PNPieChart */ = {
isa = PBXGroup;
children = (
F938F7DF1917727E00B4448E /* PNPieChart.h */,
F938F7E01917727E00B4448E /* PNPieChart.m */,
F938F7E2191772F200B4448E /* PNPieChartDataItem.h */,
F938F7E3191772F200B4448E /* PNPieChartDataItem.m */,
);
path = PNPieChart;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
...
...
@@ -402,19 +378,19 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9
FE15DFB190BB014004129F5
/* PNLineChart.m in Sources */,
9
1177EDE198DFAC400017E27
/* PNLineChart.m in Sources */,
9FE15DF8190BB014004129F5 /* PNChartLabel.m in Sources */,
91177EDC198DFAC400017E27 /* PNCircleChart.m in Sources */,
9FE15DFA190BB014004129F5 /* PNColor.m in Sources */,
9FE15DF6190BB014004129F5 /* PNBar.m in Sources */,
91177ED8198DFAC400017E27 /* PNBar.m in Sources */,
91177EE2198DFAC400017E27 /* PNLineChartDataItem.m in Sources */,
0AF7A8AF182AAEEF003645C4 /* PCChartViewController.m in Sources */,
9FE15DFD190BB014004129F5 /* PNLineChartDataItem.m in Sources */,
91177EDA198DFAC400017E27 /* PNBarChart.m in Sources */,
91177EE6198DFAC400017E27 /* PNPieChartDataItem.m in Sources */,
9FA23B10184A5944002DBBA4 /* PCChartsTableViewController.m in Sources */,
9FE15DF9190BB014004129F5 /* PNCircleChart.m in Sources */,
F938F7E4191772F200B4448E /* PNPieChartDataItem.m in Sources */,
91177EE0198DFAC400017E27 /* PNLineChartData.m in Sources */,
0AF7A874182AA9F6003645C4 /* main.m in Sources */,
9FE15DFC190BB014004129F5 /* PNLineChartData.m in Sources */,
9FE15DF7190BB014004129F5 /* PNBarChart.m in Sources */,
F938F7E11917727E00B4448E /* PNPieChart.m in Sources */,
91177EE4198DFAC400017E27 /* PNPieChart.m in Sources */,
0AF7A878182AA9F6003645C4 /* PCAppDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
...
...
@@ -423,7 +399,15 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91177EE7198DFAC400017E27 /* PNPieChartDataItem.m in Sources */,
91177EE1198DFAC400017E27 /* PNLineChartData.m in Sources */,
91177EDF198DFAC400017E27 /* PNLineChart.m in Sources */,
91177EDD198DFAC400017E27 /* PNCircleChart.m in Sources */,
91177EE3198DFAC400017E27 /* PNLineChartDataItem.m in Sources */,
0AF7A893182AA9F6003645C4 /* PNChartDemoTests.m in Sources */,
91177EE5198DFAC400017E27 /* PNPieChart.m in Sources */,
91177EDB198DFAC400017E27 /* PNBarChart.m in Sources */,
91177ED9198DFAC400017E27 /* PNBar.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
...
...
PNChartDemo/PCChartsTableViewController.m
View file @
fbd86a1
...
...
@@ -119,8 +119,13 @@
[
self
.
barChart
setXLabels
:@[
@"SEP 1"
,
@"SEP 2"
,
@"SEP 3"
,
@"SEP 4"
,
@"SEP 5"
,
@"SEP 6"
,
@"SEP 7"
]];
[
self
.
barChart
setYValues
:@[
@1
,
@24
,
@12
,
@18
,
@30
,
@10
,
@21
]];
[
self
.
barChart
setStrokeColors
:@[
PNGreen
,
PNGreen
,
PNRed
,
PNGreen
,
PNGreen
,
PNYellow
,
PNGreen
]];
// Adding gradient
self
.
barChart
.
barColorGradientStart
=
[
UIColor
blueColor
];
[
self
.
barChart
strokeChart
];
self
.
barChart
.
delegate
=
self
;
[
viewController
.
view
addSubview
:
barChartLabel
];
...
...
@@ -142,6 +147,7 @@
PNCircleChart
*
circleChart
=
[[
PNCircleChart
alloc
]
initWithFrame
:
CGRectMake
(
0
,
80
.
0
,
SCREEN_WIDTH
,
100
.
0
)
andTotal
:
@100
andCurrent
:
@60
andClockwise
:
YES
andShadow
:
YES
];
circleChart
.
backgroundColor
=
[
UIColor
clearColor
];
[
circleChart
setStrokeColor
:
PNGreen
];
[
circleChart
setStrokeColorGradientStart
:[
UIColor
blueColor
]];
[
circleChart
strokeChart
];
[
viewController
.
view
addSubview
:
circleChartLabel
];
...
...
@@ -152,7 +158,7 @@
}
else
if
([
segue
.
identifier
isEqualToString
:
@"pieChart"
])
{
//Add
Lin
eChart
//Add
Pi
eChart
UILabel
*
pieChartLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
90
,
SCREEN_WIDTH
,
30
)];
pieChartLabel
.
text
=
@"Pie Chart"
;
pieChartLabel
.
textColor
=
PNFreshGreen
;
...
...
Podfile.lock
View file @
fbd86a1
...
...
@@ -5,6 +5,6 @@ DEPENDENCIES:
- UICountingLabel (~> 1.0.0)
SPEC CHECKSUMS:
UICountingLabel:
bb976960c0130785a600aac592954c23eb395096
UICountingLabel:
0a0e9e34bf4690dbd127aaec552d19ed938087a9
COCOAPODS: 0.32.1
...
...
Please
register
or
login
to post a comment