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
Oleg Anghelov
2014-02-19 15:29:58 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5e23b7c6ae54ce8ac3412ca64c203269935032fa
5e23b7c6
1 parent
88e1cafe
extra subviews fix
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
PNChart/PNBarChart.m
PNChart/PNBarChart.m
View file @
5e23b7c
...
...
@@ -11,7 +11,11 @@
#import "PNChartLabel.h"
#import "PNBar.h"
@interface
PNBarChart
()
@interface
PNBarChart
()
{
NSMutableArray
*
_bars
;
NSMutableArray
*
_labels
;
}
-
(
UIColor
*
)
barColorAtIndex
:
(
NSUInteger
)
index
;
@end
...
...
@@ -62,6 +66,7 @@
-
(
void
)
setXLabels
:(
NSArray
*
)
xLabels
{
[
self
viewCleanupForCollection
:
_labels
];
_xLabels
=
xLabels
;
if
(
_showLabel
)
{
...
...
@@ -86,7 +91,7 @@
-
(
void
)
strokeChart
{
[
self
viewCleanupForCollection
:
_bars
];
CGFloat
chartCavanHeight
=
self
.
frame
.
size
.
height
-
chartMargin
*
2
-
40
.
0
;
NSInteger
index
=
0
;
...
...
@@ -109,6 +114,14 @@
}
}
-
(
void
)
viewCleanupForCollection
:
(
NSMutableArray
*
)
array
{
if
(
array
.
count
)
{
[
array
makeObjectsPerformSelector
:
@selector
(
removeFromSuperview
)];
[
array
removeAllObjects
];
}
}
#pragma mark - Class extension methods
-
(
UIColor
*
)
barColorAtIndex
:
(
NSUInteger
)
index
...
...
Please
register
or
login
to post a comment