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
andi
2015-03-04 23:53:25 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a3ef681410b475e6beee852e9a545c5d5bda519c
a3ef6814
1 parent
8a7628f0
some legend imporvements
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
PNChart/PNPieChart.m
PNChart/PNPieChart.m
View file @
a3ef681
...
...
@@ -269,6 +269,7 @@
CGFloat
y
=
0
;
/* accumulated width and height */
CGFloat
totalWidth
=
0
;
CGFloat
totalHeight
=
0
;
NSMutableArray
*
legendViews
=
[[
NSMutableArray
alloc
]
init
];
...
...
@@ -297,13 +298,14 @@
withWidth
:
maxLabelWidth
font
:
[
UIFont
systemFontOfSize
:
self
.
legendFontSize
]];
if
(
rowWidth
+
labelsize
.
width
>
mWidth
)
{
if
(
(
rowWidth
+
labelsize
.
width
+
beforeLabel
>
mWidth
)
&&
(
self
.
legendStyle
==
PNLegendItemStyleSerial
)
)
{
rowWidth
=
0
;
x
=
0
;
y
+=
rowMaxHeight
;
rowMaxHeight
=
0
;
}
rowWidth
+=
labelsize
.
width
;
rowWidth
+=
labelsize
.
width
+
beforeLabel
;
totalWidth
=
self
.
legendStyle
==
PNLegendItemStyleSerial
?
fmaxf
(
rowWidth
,
totalWidth
)
:
fmaxf
(
totalWidth
,
labelsize
.
width
+
beforeLabel
);
// Add inflexion type
[
legendViews
addObject
:[
self
drawInflexion
:
legendCircle
*
.
6
center
:
CGPointMake
(
x
+
legendCircle
/
2
,
y
+
singleRowHeight
/
2
)
...
...
@@ -327,7 +329,7 @@
counter
++
;
}
UIView
*
legend
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
m
Width
,
totalHeight
)];
UIView
*
legend
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
total
Width
,
totalHeight
)];
for
(
UIView
*
v
in
legendViews
)
{
[
legend
addSubview
:
v
];
...
...
Please
register
or
login
to post a comment