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-12 05:00:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1dc88b0912f4f157aa749f82bb5ed9cccd10d4aa
1dc88b09
1 parent
39dab068
Change path
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
PNChart/PNLineChart.m
PNChart/PNLineChart.m
View file @
1dc88b0
...
...
@@ -502,6 +502,40 @@
-
(
void
)
updateChartData
:
(
NSArray
*
)
data
{
_chartData
=
data
;
[
self
calculateChartPath
:
_chartPath
andPointsPath
:
_pointPath
andPathKeyPoints
:
_pathPoints
];
for
(
NSUInteger
lineIndex
=
0
;
lineIndex
<
self
.
chartData
.
count
;
lineIndex
++
)
{
CAShapeLayer
*
chartLine
=
(
CAShapeLayer
*
)
self
.
chartLineArray
[
lineIndex
];
CAShapeLayer
*
pointLayer
=
(
CAShapeLayer
*
)
self
.
chartPointArray
[
lineIndex
];
UIBezierPath
*
progressline
=
[
_chartPath
objectAtIndex
:
lineIndex
];
UIBezierPath
*
pointPath
=
[
_pointPath
objectAtIndex
:
lineIndex
];
CABasicAnimation
*
pathAnimation
=
[
CABasicAnimation
animationWithKeyPath
:
@"path"
];
pathAnimation
.
toValue
=
(
id
)[
progressline
CGPath
];
pathAnimation
.
duration
=
0
.
5
f
;
pathAnimation
.
autoreverses
=
NO
;
pathAnimation
.
timingFunction
=
[
CAMediaTimingFunction
functionWithName
:
kCAMediaTimingFunctionEaseInEaseOut
];
[
chartLine
addAnimation
:
pathAnimation
forKey
:
@"animationKey"
];
CABasicAnimation
*
pointPathAnimation
=
[
CABasicAnimation
animationWithKeyPath
:
@"path"
];
pointPathAnimation
.
toValue
=
(
id
)[
pointPath
CGPath
];
pointPathAnimation
.
duration
=
0
.
5
f
;
pointPathAnimation
.
autoreverses
=
NO
;
pointPathAnimation
.
timingFunction
=
[
CAMediaTimingFunction
functionWithName
:
kCAMediaTimingFunctionEaseInEaseOut
];
[
pointLayer
addAnimation
:
pointPathAnimation
forKey
:
@"animationKey"
];
chartLine
.
path
=
progressline
.
CGPath
;
pointLayer
.
path
=
pointPath
.
CGPath
;
}
}
...
...
Please
register
or
login
to post a comment