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
Zhang Hang
2015-03-01 18:59:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f7afaddcf83371f4e64fd532dd9abc9335694135
f7afaddc
1 parent
9c2c94b3
Refactor
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
PNChart/PNPieChart.m
PNChart/PNPieChart.m
View file @
f7afadd
...
...
@@ -124,16 +124,11 @@
CGFloat
rad
=
centerPercentage
*
2
*
M_PI
;
UILabel
*
descriptionLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
100
,
80
)];
NSString
*
titleText
=
currentDataItem
.
textDescription
;
if
(
!
titleText
){
titleText
=
[
NSString
stringWithFormat
:
@"%.0f%%"
,[
self
ratioForItemAtIndex
:
index
]
*
100
];
descriptionLabel
.
text
=
titleText
;
}
else
{
NSString
*
str
=
[
NSString
stringWithFormat
:
@"%.0f%%
\n
"
,[
self
ratioForItemAtIndex
:
index
]
*
100
];
str
=
[
str
stringByAppendingString
:
titleText
];
descriptionLabel
.
text
=
str
;
NSString
*
titleText
=
[
NSString
stringWithFormat
:
@"%.0f%%"
,[
self
ratioForItemAtIndex
:
index
]
*
100
];
if
(
currentDataItem
.
textDescription
){
titleText
=
[
titleText
stringByAppendingFormat
:
@"
\n
%@"
,
currentDataItem
.
textDescription
];
}
descriptionLabel
.
text
=
titleText
;
CGPoint
center
=
CGPointMake
(
_outerCircleRadius
+
distance
*
sin
(
rad
),
_outerCircleRadius
-
distance
*
cos
(
rad
));
...
...
Please
register
or
login
to post a comment