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
kevinzhow
2015-03-17 02:17:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
875c581e235fa75fca307c71a5b34eafbebf9da1
875c581e
1 parent
6579265d
Fix warnnings
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
PNChart/PNBarChart.m
PNChart/PNLineChart.m
PNChart/PNBarChart.m
View file @
875c581
...
...
@@ -69,7 +69,7 @@
_yValues
=
yValues
;
//make the _yLabelSum value dependant of the distinct values of yValues to avoid duplicates on yAxis
int
yLabelsDifTotal
=
[
NSSet
setWithArray
:
yValues
].
count
;
int
yLabelsDifTotal
=
(
int
)
[
NSSet
setWithArray
:
yValues
].
count
;
_yLabelSum
=
yLabelsDifTotal
%
2
==
0
?
yLabelsDifTotal
:
yLabelsDifTotal
+
1
;
if
(
_yMaxValue
)
{
...
...
PNChart/PNLineChart.m
View file @
875c581
...
...
@@ -138,7 +138,6 @@
for
(
int
index
=
0
;
index
<
yLabels
.
count
;
index
++
)
{
labelText
=
yLabels
[
index
];
#warning modify origin
NSInteger
y
=
(
NSInteger
)(
_chartCavanHeight
-
index
*
yStepHeight
);
PNChartLabel
*
label
=
[[
PNChartLabel
alloc
]
initWithFrame
:
CGRectMake
(
0
.
0
,
y
,
(
NSInteger
)
_chartMargin
,
(
NSInteger
)
_yLabelHeight
)];
...
...
@@ -260,7 +259,7 @@
CGPoint
p2
=
[
linePointsArray
[
i
+
1
]
CGPointValue
];
// Closest distance from point to line
float
distance
=
fabs
f
(((
p2
.
x
-
p1
.
x
)
*
(
touchPoint
.
y
-
p1
.
y
))
-
((
p1
.
x
-
touchPoint
.
x
)
*
(
p1
.
y
-
p2
.
y
)));
float
distance
=
fabs
(((
p2
.
x
-
p1
.
x
)
*
(
touchPoint
.
y
-
p1
.
y
))
-
((
p1
.
x
-
touchPoint
.
x
)
*
(
p1
.
y
-
p2
.
y
)));
distance
/=
hypot
(
p2
.
x
-
p1
.
x
,
p1
.
y
-
p2
.
y
);
if
(
distance
<=
5
.
0
)
{
...
...
@@ -292,7 +291,7 @@
CGPoint
p1
=
[
linePointsArray
[
i
]
CGPointValue
];
CGPoint
p2
=
[
linePointsArray
[
i
+
1
]
CGPointValue
];
float
distanceToP1
=
fabs
f
(
hypot
(
touchPoint
.
x
-
p1
.
x
,
touchPoint
.
y
-
p1
.
y
));
float
distanceToP1
=
fabs
(
hypot
(
touchPoint
.
x
-
p1
.
x
,
touchPoint
.
y
-
p1
.
y
));
float
distanceToP2
=
hypot
(
touchPoint
.
x
-
p2
.
x
,
touchPoint
.
y
-
p2
.
y
);
float
distance
=
MIN
(
distanceToP1
,
distanceToP2
);
...
...
Please
register
or
login
to post a comment