Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
flot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
flot
Commits
d973ba22
Commit
d973ba22
authored
Nov 26, 2013
by
David Schnur
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1198 from dnschnur/axis-grid-fix
Distinguish between the first and innermost axis.
parents
7fa063e9
edac9e0e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
17 deletions
+30
-17
jquery.flot.js
jquery.flot.js
+30
-17
No files found.
jquery.flot.js
View file @
d973ba22
...
...
@@ -1400,37 +1400,50 @@ Licensed under the MIT license.
var
lw
=
axis
.
labelWidth
,
lh
=
axis
.
labelHeight
,
pos
=
axis
.
options
.
position
,
isXAxis
=
axis
.
direction
===
"x"
,
tickLength
=
axis
.
options
.
tickLength
,
axisMargin
=
options
.
grid
.
axisMargin
,
padding
=
options
.
grid
.
labelMargin
,
all
=
axis
.
direction
==
"x"
?
xaxes
:
yaxes
,
index
,
innermost
;
// determine axis margin
var
samePosition
=
$
.
grep
(
all
,
function
(
a
)
{
return
a
&&
a
.
options
.
position
==
pos
&&
a
.
reserveSpace
;
innermost
=
true
,
outermost
=
true
,
first
=
true
,
found
=
false
;
// Determine the axis's position in its direction and on its side
$
.
each
(
isXAxis
?
xaxes
:
yaxes
,
function
(
i
,
a
)
{
if
(
a
&&
a
.
reserveSpace
)
{
if
(
a
===
axis
)
{
found
=
true
;
}
else
if
(
a
.
options
.
position
===
pos
)
{
if
(
found
)
{
outermost
=
false
;
}
else
{
innermost
=
false
;
}
}
if
(
!
found
)
{
first
=
false
;
}
}
});
if
(
$
.
inArray
(
axis
,
samePosition
)
==
samePosition
.
length
-
1
)
axisMargin
=
0
;
// outermost
//
Determine whether the axis is the first (innermost) on its side
//
The outermost axis on each side has no margin
innermost
=
$
.
inArray
(
axis
,
samePosition
)
==
0
;
if
(
outermost
)
{
axisMargin
=
0
;
}
//
determine tick length - if we're innermost, we can use "full"
//
The ticks for the first axis in each direction stretch across
if
(
tickLength
==
null
)
{
if
(
innermost
)
tickLength
=
"full"
;
else
tickLength
=
5
;
tickLength
=
first
?
"full"
:
5
;
}
if
(
!
isNaN
(
+
tickLength
))
padding
+=
+
tickLength
;
// compute box
if
(
axis
.
direction
==
"x"
)
{
if
(
isXAxis
)
{
lh
+=
padding
;
if
(
pos
==
"bottom"
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment