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
2013-12-17 09:32:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8c02df9496f5901b21de193a04db3e4d8d3cb5c9
8c02df94
1 parent
47e8c79c
Update example
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
PNChartDemo/PCChartsTableViewController.m
PNChartDemo/PCChartsTableViewController.m
View file @
8c02df9
...
...
@@ -65,21 +65,23 @@
[
lineChart
setXLabels
:@[
@"SEP 1"
,
@"SEP 2"
,
@"SEP 3"
,
@"SEP 4"
,
@"SEP 5"
,
@"SEP 6"
,
@"SEP 7"
]];
// Line Chart Nr.1
NSArray
*
data01Array
=
@[
@60.1
,
@160.1
,
@126.4
,
@262.2
,
@186.2
,
@127.2
,
@176.2
];
PNLineChartData
*
data01
=
[
PNLineChartData
new
];
data01
.
color
=
PNFreshGreen
;
data01
.
itemCount
=
lineChart
.
xLabels
.
count
;
data01
.
getData
=
^
(
NSUInteger
i
tem
)
{
CGFloat
y
=
item
*
10
;
return
[
PNLineChartDataItem
dataItemWithY
:
y
];
data01
.
getData
=
^
(
NSUInteger
i
ndex
)
{
CGFloat
y
Value
=
[[
data01Array
objectAtIndex
:
index
]
floatValue
]
;
return
[
PNLineChartDataItem
dataItemWithY
:
y
Value
];
};
// Line Chart Nr.2
NSArray
*
data02Array
=
@[
@20.1
,
@180.1
,
@26.4
,
@202.2
,
@126.2
,
@167.2
,
@276.2
];
PNLineChartData
*
data02
=
[
PNLineChartData
new
];
data02
.
color
=
PNTwitterColor
;
data02
.
itemCount
=
lineChart
.
xLabels
.
count
;
data02
.
getData
=
^
(
NSUInteger
i
tem
)
{
CGFloat
y
=
item
==
0
?
(
item
*
5
)
+
10
:
(
item
*
5
)
;
return
[
PNLineChartDataItem
dataItemWithY
:
y
];
data02
.
getData
=
^
(
NSUInteger
i
ndex
)
{
CGFloat
y
Value
=
[[
data02Array
objectAtIndex
:
index
]
floatValue
]
;
return
[
PNLineChartDataItem
dataItemWithY
:
y
Value
];
};
lineChart
.
chartData
=
@[
data01
,
data02
];
...
...
Please
register
or
login
to post a comment