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
f42e4edd
Commit
f42e4edd
authored
Jul 22, 2013
by
David Schnur
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1074 from cleroux/master
Fixing Issue 686: Tooltip bug
parents
fca41ad5
caf1c7c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
25 deletions
+13
-25
index.html
examples/interacting/index.html
+13
-25
No files found.
examples/interacting/index.html
View file @
f42e4edd
...
...
@@ -41,20 +41,15 @@
}
});
function
showTooltip
(
x
,
y
,
contents
)
{
$
(
"<div id='tooltip'>"
+
contents
+
"</div>"
).
css
({
position
:
"absolute"
,
display
:
"none"
,
top
:
y
+
5
,
left
:
x
+
5
,
border
:
"1px solid #fdd"
,
padding
:
"2px"
,
"background-color"
:
"#fee"
,
opacity
:
0.80
}).
appendTo
(
"body"
).
fadeIn
(
200
);
}
$
(
"<div id='tooltip'></div>"
).
css
({
position
:
"absolute"
,
display
:
"none"
,
border
:
"1px solid #fdd"
,
padding
:
"2px"
,
"background-color"
:
"#fee"
,
opacity
:
0.80
}).
appendTo
(
"body"
);
var
previousPoint
=
null
;
$
(
"#placeholder"
).
bind
(
"plothover"
,
function
(
event
,
pos
,
item
)
{
if
(
$
(
"#enablePosition:checked"
).
length
>
0
)
{
...
...
@@ -64,20 +59,14 @@
if
(
$
(
"#enableTooltip:checked"
).
length
>
0
)
{
if
(
item
)
{
if
(
previousPoint
!=
item
.
dataIndex
)
{
previousPoint
=
item
.
dataIndex
;
$
(
"#tooltip"
).
remove
();
var
x
=
item
.
datapoint
[
0
].
toFixed
(
2
),
var
x
=
item
.
datapoint
[
0
].
toFixed
(
2
),
y
=
item
.
datapoint
[
1
].
toFixed
(
2
);
showTooltip
(
item
.
pageX
,
item
.
pageY
,
item
.
series
.
label
+
" of "
+
x
+
" = "
+
y
);
}
$
(
"#tooltip"
).
html
(
item
.
series
.
label
+
" of "
+
x
+
" = "
+
y
)
.
css
({
top
:
item
.
pageY
+
5
,
left
:
item
.
pageX
+
5
})
.
fadeIn
(
200
);
}
else
{
$
(
"#tooltip"
).
remove
();
previousPoint
=
null
;
$
(
"#tooltip"
).
hide
();
}
}
});
...
...
@@ -97,7 +86,6 @@
</script>
</head>
<body>
<div
id=
"header"
>
<h2>
Interactivity
</h2>
</div>
...
...
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