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
a0b1552d
Commit
a0b1552d
authored
Nov 11, 2012
by
Mike Malamud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for issue #860, Recalculate tickSize on updates
parent
1262aa39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
29 deletions
+36
-29
jquery.flot.js
jquery.flot.js
+36
-29
No files found.
jquery.flot.js
View file @
a0b1552d
...
...
@@ -1244,40 +1244,47 @@
if
(
!
axis
.
tickGenerator
)
{
var
maxDec
=
opts
.
tickDecimals
;
var
dec
=
-
Math
.
floor
(
Math
.
log
(
axis
.
delta
)
/
Math
.
LN10
);
if
(
maxDec
!=
null
&&
dec
>
maxDec
)
dec
=
maxDec
;
var
magn
=
Math
.
pow
(
10
,
-
dec
);
var
norm
=
axis
.
delta
/
magn
;
// norm is between 1.0 and 10.0
var
size
;
if
(
norm
<
1.5
)
size
=
1
;
else
if
(
norm
<
3
)
{
size
=
2
;
// special case for 2.5, requires an extra decimal
if
(
norm
>
2.25
&&
(
maxDec
==
null
||
dec
+
1
<=
maxDec
))
{
size
=
2.5
;
++
dec
;
axis
.
tickGenerator
=
function
(
axis
)
{
var
maxDec
=
opts
.
tickDecimals
,
dec
=
-
Math
.
floor
(
Math
.
log
(
axis
.
delta
)
/
Math
.
LN10
);
if
(
maxDec
!=
null
&&
dec
>
maxDec
)
dec
=
maxDec
;
var
magn
=
Math
.
pow
(
10
,
-
dec
),
norm
=
axis
.
delta
/
magn
,
// norm is between 1.0 and 10.0
size
,
ticks
=
[],
start
,
i
=
0
,
v
=
Number
.
NaN
,
prev
;
if
(
norm
<
1.5
)
size
=
1
;
else
if
(
norm
<
3
)
{
size
=
2
;
// special case for 2.5, requires an extra decimal
if
(
norm
>
2.25
&&
(
maxDec
==
null
||
dec
+
1
<=
maxDec
))
{
size
=
2.5
;
++
dec
;
}
}
}
else
if
(
norm
<
7.5
)
size
=
5
;
else
size
=
10
;
else
if
(
norm
<
7.5
)
size
=
5
;
else
size
=
10
;
size
*=
magn
;
size
*=
magn
;
if
(
opts
.
minTickSize
!=
null
&&
size
<
opts
.
minTickSize
)
size
=
opts
.
minTickSize
;
if
(
opts
.
minTickSize
!=
null
&&
size
<
opts
.
minTickSize
)
size
=
opts
.
minTickSize
;
axis
.
tickDecimals
=
Math
.
max
(
0
,
maxDec
!=
null
?
maxDec
:
dec
);
axis
.
tickSize
=
opts
.
tickSize
||
size
;
axis
.
tickDecimals
=
Math
.
max
(
0
,
maxDec
!=
null
?
maxDec
:
dec
);
axis
.
tickSize
=
opts
.
tickSize
||
size
;
start
=
floorInBase
(
axis
.
min
,
axis
.
tickSize
)
axis
.
tickGenerator
=
function
(
axis
)
{
var
ticks
=
[],
start
=
floorInBase
(
axis
.
min
,
axis
.
tickSize
),
i
=
0
,
v
=
Number
.
NaN
,
prev
;
do
{
prev
=
v
;
v
=
start
+
i
*
axis
.
tickSize
;
...
...
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