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
cfe16e1e
Commit
cfe16e1e
authored
Jun 10, 2013
by
David Schnur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename labelWidth/Height to tickWidth/Height.
parent
b079efca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
21 deletions
+25
-21
API.md
API.md
+3
-4
jquery.flot.js
jquery.flot.js
+22
-17
No files found.
API.md
View file @
cfe16e1e
...
...
@@ -264,12 +264,11 @@ xaxis, yaxis: {
tickFormatter
:
(
fn
:
number
,
object
->
string
)
or
string
tickDecimals
:
null
or
number
labelWidth
:
null
or
number
labelHeight
:
null
or
number
reserveSpace
:
null
or
true
tickLength
:
null
or
number
tickWidth
:
null
or
number
tickHeight
:
null
or
number
reserveSpace
:
null
or
true
alignTicksWithAxis
:
null
or
number
}
```
...
...
jquery.flot.js
View file @
cfe16e1e
...
...
@@ -495,8 +495,8 @@ Licensed under the MIT license.
autoscaleMargin
:
null
,
// margin in % to add if auto-setting min/max
ticks
:
null
,
// either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks
tickFormatter
:
null
,
// fn: number -> string
label
Width
:
null
,
// size of tick labels in pixels
label
Height
:
null
,
tick
Width
:
null
,
// size of tick labels in pixels
tick
Height
:
null
,
reserveSpace
:
null
,
// whether to reserve space even if axis isn't shown
tickLength
:
null
,
// size in pixels of ticks, or "full" for whole line
alignTicksWithAxis
:
null
,
// axis number or null for no sync
...
...
@@ -1370,9 +1370,10 @@ Licensed under the MIT license.
var
opts
=
axis
.
options
,
ticks
=
axis
.
ticks
||
[],
labelWidth
=
opts
.
labelWidth
||
0
,
labelHeight
=
opts
.
labelHeight
||
0
,
maxWidth
=
labelWidth
||
axis
.
direction
===
"x"
?
Math
.
floor
(
surface
.
width
/
(
ticks
.
length
||
1
))
:
null
,
// Label width & height are deprecated; remove in 1.0!
tickWidth
=
opts
.
tickWidth
||
opts
.
labelWidth
||
0
,
tickHeight
=
opts
.
tickHeight
||
opts
.
labelHeight
||
0
,
maxWidth
=
tickWidth
||
axis
.
direction
===
"x"
?
Math
.
floor
(
surface
.
width
/
(
ticks
.
length
||
1
))
:
null
,
legacyStyles
=
axis
.
direction
+
"Axis "
+
axis
.
direction
+
axis
.
n
+
"Axis"
,
layer
=
"flot-"
+
axis
.
direction
+
"-axis flot-"
+
axis
.
direction
+
axis
.
n
+
"-axis "
+
legacyStyles
,
font
=
opts
.
font
||
"flot-tick-label tickLabel"
;
...
...
@@ -1387,12 +1388,17 @@ Licensed under the MIT license.
var
info
=
surface
.
getTextInfo
(
layer
,
t
.
label
,
font
,
null
,
maxWidth
);
labelWidth
=
Math
.
max
(
label
Width
,
info
.
width
);
labelHeight
=
Math
.
max
(
label
Height
,
info
.
height
);
tickWidth
=
Math
.
max
(
tick
Width
,
info
.
width
);
tickHeight
=
Math
.
max
(
tick
Height
,
info
.
height
);
}
axis
.
labelWidth
=
opts
.
labelWidth
||
labelWidth
;
axis
.
labelHeight
=
opts
.
labelHeight
||
labelHeight
;
axis
.
tickWidth
=
opts
.
tickWidth
||
opts
.
labelWidth
||
tickWidth
;
axis
.
tickHeight
=
opts
.
tickHeight
||
opts
.
labelHeight
||
tickHeight
;
// Label width/height properties are deprecated; remove in 1.0!
axis
.
labelWidth
=
axis
.
tickWidth
;
axis
.
labelHeight
=
axis
.
tickHeight
;
}
function
allocateAxisBoxFirstPhase
(
axis
)
{
...
...
@@ -1402,8 +1408,8 @@ Licensed under the MIT license.
// dimension per axis, the other dimension depends on the
// other axes so will have to wait
var
lw
=
axis
.
label
Width
,
lh
=
axis
.
label
Height
,
var
lw
=
axis
.
tick
Width
,
lh
=
axis
.
tick
Height
,
pos
=
axis
.
options
.
position
,
tickLength
=
axis
.
options
.
tickLength
,
axisMargin
=
options
.
grid
.
axisMargin
,
...
...
@@ -1471,11 +1477,11 @@ Licensed under the MIT license.
// now that all axis boxes have been placed in one
// dimension, we can set the remaining dimension coordinates
if
(
axis
.
direction
===
"x"
)
{
axis
.
box
.
left
=
plotOffset
.
left
-
axis
.
label
Width
/
2
;
axis
.
box
.
width
=
surface
.
width
-
plotOffset
.
left
-
plotOffset
.
right
+
axis
.
label
Width
;
axis
.
box
.
left
=
plotOffset
.
left
-
axis
.
tick
Width
/
2
;
axis
.
box
.
width
=
surface
.
width
-
plotOffset
.
left
-
plotOffset
.
right
+
axis
.
tick
Width
;
}
else
{
axis
.
box
.
top
=
plotOffset
.
top
-
axis
.
label
Height
/
2
;
axis
.
box
.
height
=
surface
.
height
-
plotOffset
.
bottom
-
plotOffset
.
top
+
axis
.
label
Height
;
axis
.
box
.
top
=
plotOffset
.
top
-
axis
.
tick
Height
/
2
;
axis
.
box
.
height
=
surface
.
height
-
plotOffset
.
bottom
-
plotOffset
.
top
+
axis
.
tick
Height
;
}
}
...
...
@@ -1504,7 +1510,7 @@ Licensed under the MIT license.
$
.
each
(
allAxes
(),
function
(
_
,
axis
)
{
var
dir
=
axis
.
direction
;
if
(
axis
.
reserveSpace
)
{
margins
[
dir
]
=
Math
.
ceil
(
Math
.
max
(
margins
[
dir
],
(
dir
===
"x"
?
axis
.
labelWidth
:
axis
.
label
Height
)
/
2
));
margins
[
dir
]
=
Math
.
ceil
(
Math
.
max
(
margins
[
dir
],
(
dir
===
"x"
?
axis
.
tickWidth
:
axis
.
tick
Height
)
/
2
));
}
});
...
...
@@ -1561,7 +1567,6 @@ Licensed under the MIT license.
setupTickGeneration
(
axis
);
setTicks
(
axis
);
snapRangeToTicks
(
axis
,
axis
.
ticks
);
// find labelWidth/Height for axis
measureTickLabels
(
axis
);
});
...
...
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