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-04-26 17:37:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c930f6a69bc6f47bf8ee7bfd1e3c37978e78e72a
c930f6a6
1 parent
1823eecb
Fix Bar chart x label position
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
7 deletions
PNChart/PNBarChart/PNBarChart.m
PNChart/PNBarChart/PNBarChart.m
View file @
c930f6a
...
...
@@ -123,14 +123,8 @@
label
.
textColor
=
_labelTextColor
;
[
label
setTextAlignment
:
NSTextAlignmentCenter
];
label
.
text
=
labelText
;
NSLog
(
@"Label text is %@"
,
labelText
);
[
label
sizeToFit
];
CGFloat
labelXPosition
;
if
(
label
.
frame
.
size
.
width
<
_xLabelWidth
)
{
labelXPosition
=
(
index
*
_xLabelWidth
+
_chartMargin
+
_xLabelWidth
/
2
.
0
);
}
else
{
labelXPosition
=
(
index
*
_xLabelWidth
+
_chartMargin
+
label
.
frame
.
size
.
width
/
2
.
0
);
}
CGFloat
labelXPosition
=
(
index
*
_xLabelWidth
+
_chartMargin
+
_xLabelWidth
/
2
.
0
);
label
.
center
=
CGPointMake
(
labelXPosition
,
self
.
frame
.
size
.
height
-
xLabelHeight
-
_chartMargin
+
label
.
frame
.
size
.
height
/
2
.
0
+
_labelMarginTop
);
...
...
Please
register
or
login
to post a comment