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
dullgrass
2015-05-14 17:26:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7c46ed229ec261b14abc6558e93ab4c9f70a5aef
7c46ed22
1 parent
74652e09
fix bug - unsupport yLabels
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
PNChart/PNBarChart.m
PNChart/PNBarChart.m
View file @
7c46ed2
...
...
@@ -72,7 +72,7 @@
//make the _yLabelSum value dependant of the distinct values of yValues to avoid duplicates on yAxis
int
yLabelsDifTotal
=
(
int
)[
NSSet
setWithArray
:
yValues
].
count
;
// !!!:
调整Y坐标的显示
值
// !!!:
生效Y轴坐标的最大
值
if
(
_yLabelSum
==
defaultYSum
)
{
_yLabelSum
=
yLabelsDifTotal
%
2
==
0
?
yLabelsDifTotal
:
yLabelsDifTotal
+
1
;
}
...
...
@@ -85,7 +85,7 @@
if
(
_yChartLabels
)
{
[
self
viewCleanupForCollection
:
_yChartLabels
];
}
else
{
}
else
{
_yLabels
=
[
NSMutableArray
new
];
}
...
...
@@ -93,7 +93,15 @@
//Add y labels
float
yLabelSectionHeight
=
(
self
.
frame
.
size
.
height
-
_chartMargin
*
2
-
kXLabelHeight
)
/
_yLabelSum
;
// !!!: 用户自行修改Y轴坐标值
[
self
__addYCoordinateLabelsValuesWithyLabelSectionHeight
:
yLabelSectionHeight
];
}
}
#pragma mark - Private Method
#pragma mark - 添加柱状图的Y轴坐标
-
(
void
)
__addYCoordinateLabelsValuesWithyLabelSectionHeight
:
(
float
)
yLabelSectionHeight
{
if
(
_yLabels
)
{
[
self
getYValueMax
:
_yLabels
];
...
...
@@ -138,7 +146,6 @@
}
}
}
}
-
(
void
)
updateChartData
:
(
NSArray
*
)
data
{
...
...
Please
register
or
login
to post a comment