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
2014-12-18 06:46:53 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
ba7af38d345592e0aa6856388ace7174f8399784
ba7af38d
2 parents
9e514ee7
590c5de6
Merge branch 'master' of github.com:kevinzhow/PNChart
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
2 deletions
PNChart/PNLineChart.m
PNChart/PNLineChartData.h
PNChart/PNLineChartData.m
PNChartDemo/PCChartViewController.m
PNChart/PNLineChart.m
View file @
ba7af38
...
...
@@ -262,7 +262,7 @@
UIGraphicsBeginImageContext
(
self
.
frame
.
size
);
// setup the color of the chart line
if
(
chartData
.
color
)
{
chartLine
.
strokeColor
=
[
chartData
.
color
CGColor
];
chartLine
.
strokeColor
=
[
[
chartData
.
color
colorWithAlphaComponent
:
chartData
.
alpha
]
CGColor
];
}
else
{
chartLine
.
strokeColor
=
[
PNGreen
CGColor
];
pointLayer
.
strokeColor
=
[
PNGreen
CGColor
];
...
...
@@ -471,7 +471,7 @@
// create point
CAShapeLayer
*
pointLayer
=
[
CAShapeLayer
layer
];
pointLayer
.
strokeColor
=
[
chartData
.
color
CGColor
];
pointLayer
.
strokeColor
=
[
[
chartData
.
color
colorWithAlphaComponent
:
chartData
.
alpha
]
CGColor
];
pointLayer
.
lineCap
=
kCALineCapRound
;
pointLayer
.
lineJoin
=
kCALineJoinBevel
;
pointLayer
.
fillColor
=
nil
;
...
...
PNChart/PNLineChartData.h
View file @
ba7af38
...
...
@@ -19,6 +19,7 @@ typedef PNLineChartDataItem *(^LCLineChartDataGetter)(NSUInteger item);
@interface
PNLineChartData
:
NSObject
@property
(
strong
)
UIColor
*
color
;
@property
(
nonatomic
)
CGFloat
alpha
;
@property
NSUInteger
itemCount
;
@property
(
copy
)
LCLineChartDataGetter
getData
;
...
...
PNChart/PNLineChartData.m
View file @
ba7af38
...
...
@@ -22,6 +22,7 @@
_inflexionPointStyle
=
PNLineChartPointStyleNone
;
_inflexionPointWidth
=
6
.
f
;
_lineWidth
=
2
.
f
;
_alpha
=
1
.
f
;
}
@end
...
...
PNChartDemo/PCChartViewController.m
View file @
ba7af38
...
...
@@ -35,6 +35,7 @@
NSArray
*
data01Array
=
@[
@60.1
,
@160.1
,
@126.4
,
@262.2
,
@186.2
,
@127.2
,
@176.2
];
PNLineChartData
*
data01
=
[
PNLineChartData
new
];
data01
.
color
=
PNFreshGreen
;
data01
.
alpha
=
0
.
3
f
;
data01
.
itemCount
=
data01Array
.
count
;
data01
.
inflexionPointStyle
=
PNLineChartPointStyleTriangle
;
data01
.
getData
=
^
(
NSUInteger
index
)
{
...
...
@@ -46,6 +47,7 @@
NSArray
*
data02Array
=
@[
@20.1
,
@180.1
,
@26.4
,
@202.2
,
@126.2
,
@167.2
,
@276.2
];
PNLineChartData
*
data02
=
[
PNLineChartData
new
];
data02
.
color
=
PNTwitterColor
;
data02
.
alpha
=
0
.
5
f
;
data02
.
itemCount
=
data02Array
.
count
;
data02
.
inflexionPointStyle
=
PNLineChartPointStyleSquare
;
data02
.
getData
=
^
(
NSUInteger
index
)
{
...
...
Please
register
or
login
to post a comment