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
mobileflowllc
2014-08-03 17:19:31 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
836750d10f9f8fac6fd1ec7c342b5b18e43f4648
836750d1
1 parent
05d2aa44
Fixing bug on line chart showLabel
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
PNChart/PNLineChart.m
PNChart/PNLineChart.m
View file @
836750d
...
...
@@ -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
;
}
}
}
...
...
Please
register
or
login
to post a comment