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
Kevin
2015-03-11 20:16:18 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
fa45195829149893e5bf7324357c407dedd2c22f
fa451958
2 parents
4f500ca0
482858b0
Merge pull request #173 from ArcadiaConsulting/master
Avoid labels on Y axis duplicate
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
PNChart/PNBarChart.m
PNChart/PNBarChart.m
View file @
fa45195
...
...
@@ -68,6 +68,10 @@
{
_yValues
=
yValues
;
//make the _yLabelSum value dependant of the distinct values of yValues to avoid duplicates on yAxis
int
yLabelsDifTotal
=
[
NSSet
setWithArray
:
yValues
].
count
;
_yLabelSum
=
yLabelsDifTotal
%
2
==
0
?
yLabelsDifTotal
:
yLabelsDifTotal
+
1
;
if
(
_yMaxValue
)
{
_yValueMax
=
_yMaxValue
;
}
else
{
...
...
@@ -114,7 +118,8 @@
{
int
max
=
[[
yLabels
valueForKeyPath
:
@"@max.intValue"
]
intValue
];
_yValueMax
=
(
int
)
max
;
//ensure max is even
_yValueMax
=
max
%
2
==
0
?
max
:
max
+
1
;
if
(
_yValueMax
==
0
)
{
_yValueMax
=
_yMinValue
;
...
...
Please
register
or
login
to post a comment