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
Gianmaria Dal Maistro
2015-09-01 10:45:28 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1be8954d25e465633a04e8c60ccf6ab5a12e1868
1be8954d
1 parent
8e83a89b
show only titles, not values nor percentage
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
PNChart/PNPieChart.h
PNChart/PNPieChart.m
PNChart/PNPieChart.h
View file @
1be8954
...
...
@@ -32,6 +32,9 @@
/** Default is 1.0. */
@property
(
nonatomic
)
NSTimeInterval
duration
;
/** show only tiles, not values or percentage */
@property
(
nonatomic
)
BOOL
hideValues
;
/** Show only values, this is useful when legend is present */
@property
(
nonatomic
)
BOOL
showOnlyValues
;
...
...
PNChart/PNPieChart.m
View file @
1be8954
...
...
@@ -57,6 +57,11 @@
_descriptionTextShadowOffset
=
CGSizeMake
(
0
,
1
);
_duration
=
1
.
0
;
_shouldHighlightSectorOnTouch
=
YES
;
<<<<<<<
Updated
upstream
=======
_enableMultipleSelection
=
NO
;
_hideValues
=
NO
;
>>>>>>>
Stashed
changes
[
super
setupDefaultValues
];
[
self
loadDefault
];
...
...
@@ -130,6 +135,7 @@
UILabel
*
descriptionLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
100
,
80
)];
NSString
*
titleText
=
currentDataItem
.
textDescription
;
NSString
*
titleValue
;
if
(
self
.
showAbsoluteValues
)
{
...
...
@@ -137,9 +143,11 @@
}
else
{
titleValue
=
[
NSString
stringWithFormat
:
@"%.0f%%"
,[
self
ratioForItemAtIndex
:
index
]
*
100
];
}
if
(
!
titleText
||
self
.
showOnlyValues
){
if
(
self
.
hideValues
)
descriptionLabel
.
text
=
titleText
;
else
if
(
!
titleText
||
self
.
showOnlyValues
)
descriptionLabel
.
text
=
titleValue
;
}
else
{
NSString
*
str
=
[
titleValue
stringByAppendingString
:[
NSString
stringWithFormat
:
@"
\n
%@"
,
titleText
]];
descriptionLabel
.
text
=
str
;
...
...
Please
register
or
login
to post a comment