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
onevcat
2014-12-25 10:26:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
812f642351d1d80346374550b6017ee3af711498
812f6423
1 parent
815f5f98
Add initWithCoder for bar chart
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
17 deletions
PNChart/PNBarChart.m
PNChart/PNBarChart.m
View file @
812f642
...
...
@@ -22,33 +22,47 @@
@implementation
PNBarChart
-
(
id
)
initWithCoder
:(
NSCoder
*
)
aDecoder
{
self
=
[
super
initWithCoder
:
aDecoder
];
if
(
self
)
{
[
self
setupDefaultValues
];
}
return
self
;
}
-
(
id
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
clipsToBounds
=
YES
;
_showLabel
=
YES
;
_barBackgroundColor
=
PNLightGrey
;
_labelTextColor
=
[
UIColor
grayColor
];
_labelFont
=
[
UIFont
systemFontOfSize
:
11
.
0
f
];
_xChartLabels
=
[
NSMutableArray
array
];
_yChartLabels
=
[
NSMutableArray
array
];
_bars
=
[
NSMutableArray
array
];
_xLabelSkip
=
1
;
_yLabelSum
=
4
;
_labelMarginTop
=
0
;
_chartMargin
=
15
.
0
;
_barRadius
=
2
.
0
;
_showChartBorder
=
NO
;
_yChartLabelWidth
=
18
;
_rotateForXAxisText
=
false
;
[
self
setupDefaultValues
];
}
return
self
;
}
-
(
void
)
setupDefaultValues
{
self
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
clipsToBounds
=
YES
;
_showLabel
=
YES
;
_barBackgroundColor
=
PNLightGrey
;
_labelTextColor
=
[
UIColor
grayColor
];
_labelFont
=
[
UIFont
systemFontOfSize
:
11
.
0
f
];
_xChartLabels
=
[
NSMutableArray
array
];
_yChartLabels
=
[
NSMutableArray
array
];
_bars
=
[
NSMutableArray
array
];
_xLabelSkip
=
1
;
_yLabelSum
=
4
;
_labelMarginTop
=
0
;
_chartMargin
=
15
.
0
;
_barRadius
=
2
.
0
;
_showChartBorder
=
NO
;
_yChartLabelWidth
=
18
;
_rotateForXAxisText
=
false
;
}
-
(
void
)
setYValues
:
(
NSArray
*
)
yValues
{
...
...
Please
register
or
login
to post a comment