Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
c3-closed
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Evgeny
c3-closed
Commits
4049d4f0
Commit
4049d4f0
authored
Mar 26, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tooltip
parent
624230af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
c3.js
c3.js
+6
-7
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
4049d4f0
...
@@ -321,8 +321,9 @@
...
@@ -321,8 +321,9 @@
var
leftAxisClass
=
__axis_rotated
?
".x.axis"
:
".y.axis"
,
var
leftAxisClass
=
__axis_rotated
?
".x.axis"
:
".y.axis"
,
leftAxis
=
d3
.
select
(
leftAxisClass
).
node
(),
leftAxis
=
d3
.
select
(
leftAxisClass
).
node
(),
svgRect
=
leftAxis
?
leftAxis
.
getBoundingClientRect
()
:
{
right
:
0
},
svgRect
=
leftAxis
?
leftAxis
.
getBoundingClientRect
()
:
{
right
:
0
},
chartRect
=
d3
.
select
(
__bindto
).
node
().
getBoundingClientRect
();
chartRect
=
d3
.
select
(
__bindto
).
node
().
getBoundingClientRect
(),
return
svgRect
.
right
-
chartRect
.
left
-
getCurrentPaddingLeft
();
svgLeft
=
svgRect
.
right
-
chartRect
.
left
-
getCurrentPaddingLeft
();
return
svgLeft
>
0
?
svgLeft
:
0
;
}
}
function
getCurrentWidth
()
{
function
getCurrentWidth
()
{
return
__size_width
?
__size_width
:
getParentWidth
();
return
__size_width
?
__size_width
:
getParentWidth
();
...
@@ -1313,9 +1314,7 @@
...
@@ -1313,9 +1314,7 @@
// don't show tooltip when no data
// don't show tooltip when no data
if
(
dataToShow
.
length
===
0
)
{
return
;
}
if
(
dataToShow
.
length
===
0
)
{
return
;
}
// Construct tooltip
// Construct tooltip
tooltip
.
html
(
__tooltip_contents
(
selectedData
,
getXAxisTickFormat
(),
valueFormat
,
color
))
tooltip
.
html
(
__tooltip_contents
(
selectedData
,
getXAxisTickFormat
(),
valueFormat
,
color
));
.
style
(
"visibility"
,
"hidden"
)
.
style
(
"display"
,
"block"
);
// Get tooltip dimensions
// Get tooltip dimensions
tWidth
=
tooltip
.
property
(
'offsetWidth'
);
tWidth
=
tooltip
.
property
(
'offsetWidth'
);
tHeight
=
tooltip
.
property
(
'offsetHeight'
);
tHeight
=
tooltip
.
property
(
'offsetHeight'
);
...
@@ -1337,6 +1336,7 @@
...
@@ -1337,6 +1336,7 @@
chartRight
=
svgLeft
+
getCurrentWidth
()
-
getCurrentPaddingRight
();
chartRight
=
svgLeft
+
getCurrentWidth
()
-
getCurrentPaddingRight
();
tooltipTop
=
mouse
[
1
]
+
15
;
tooltipTop
=
mouse
[
1
]
+
15
;
}
}
if
(
tooltipRight
>
chartRight
)
{
if
(
tooltipRight
>
chartRight
)
{
tooltipLeft
-=
tWidth
+
60
;
tooltipLeft
-=
tWidth
+
60
;
}
}
...
@@ -1345,11 +1345,10 @@
...
@@ -1345,11 +1345,10 @@
}
}
}
}
// Set tooltip
// Set tooltip
// todo get rid of magic numbers
tooltip
tooltip
.
style
(
"top"
,
tooltipTop
+
"px"
)
.
style
(
"top"
,
tooltipTop
+
"px"
)
.
style
(
"left"
,
tooltipLeft
+
'px'
)
.
style
(
"left"
,
tooltipLeft
+
'px'
)
.
style
(
"
visibility"
,
"visible
"
);
.
style
(
"
display"
,
"block
"
);
}
}
function
hideTooltip
()
{
function
hideTooltip
()
{
tooltip
.
style
(
"display"
,
"none"
);
tooltip
.
style
(
"display"
,
"none"
);
...
...
c3.min.js
View file @
4049d4f0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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