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-11-07 14:56:57 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
57307680e4e6d599b78f0da1b8067bd5115a109a
57307680
1 parent
065bd3db
Add #import <Foundation/Foundation.h> in PNLineChat.m to fix CocoaPods bug
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
PNChartDemo/PNChart/PNBarChart.m
PNChartDemo/PNChart/PNLineChart.m
PNChartDemo/PNChart/PNBarChart.m
View file @
5730768
...
...
@@ -34,7 +34,7 @@
-
(
void
)
setYLabels
:(
NSArray
*
)
yLabels
{
int
max
=
0
;
NSInteger
max
=
0
;
for
(
NSString
*
valueString
in
yLabels
)
{
NSInteger
value
=
[
valueString
integerValue
];
if
(
value
>
max
)
{
...
...
@@ -48,7 +48,7 @@
max
=
5
;
}
_yValueMax
=
max
;
_yValueMax
=
(
int
)
max
;
NSLog
(
@"Y Max is %d"
,
_yValueMax
);
...
...
PNChartDemo/PNChart/PNLineChart.m
View file @
5730768
...
...
@@ -9,6 +9,7 @@
#import "PNLineChart.h"
#import "PNColor.h"
#import "PNChartLabel.h"
#import <Foundation/Foundation.h>
@implementation
PNLineChart
...
...
@@ -39,7 +40,7 @@
-
(
void
)
setYLabels
:(
NSArray
*
)
yLabels
{
int
max
=
0
;
NSInteger
max
=
0
;
for
(
NSString
*
valueString
in
yLabels
)
{
NSInteger
value
=
[
valueString
integerValue
];
if
(
value
>
max
)
{
...
...
@@ -53,9 +54,8 @@
max
=
5
;
}
_yValueMax
=
max
;
_yValueMax
=
(
int
)
max
;
NSLog
(
@"Y Max is %d"
,
_yValueMax
);
float
level
=
max
/
5
.
0
;
NSInteger
index
=
0
;
...
...
@@ -115,7 +115,6 @@
NSInteger
value
=
[
valueString
integerValue
];
float
grade
=
(
float
)
value
/
(
float
)
_yValueMax
;
NSLog
(
@"index is %d and value is %d ymax is %d grade is %f"
,
index
,
value
,
_yValueMax
,
grade
);
if
(
index
!=
0
)
{
[
progressline
addLineToPoint
:
CGPointMake
(
index
*
xPosition
+
30
.
0
+
_xLabelWidth
/
2
.
0
,
chartCavanHeight
-
grade
*
chartCavanHeight
+
20
.
0
)];
...
...
@@ -125,8 +124,6 @@
[
progressline
stroke
];
}
NSLog
(
@"Xvalue is %f Y value is %f"
,
index
*
xPosition
+
30
.
0
+
_xLabelWidth
/
2
.
0
,
chartCavanHeight
-
grade
*
chartCavanHeight
+
20
.
0
);
index
+=
1
;
}
...
...
Please
register
or
login
to post a comment