1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Adjusting tooltips for job detail donut chart

for better mouse movement, adding an offset based on the charts dimensions
This commit is contained in:
Jared Tabor 2015-06-09 20:19:16 -04:00
parent 885d42fdbe
commit 76e4626fbe
2 changed files with 6 additions and 3 deletions

View File

@ -1281,8 +1281,11 @@ export default
}); });
path.on('mousemove', function() { path.on('mousemove', function() {
tooltip.style('top', (d3.mouse(this)[0]+200) + 'px') // d3.mouse() gives the coordinates of hte mouse, then add
.style('left', (d3.mouse(this)[0]+200) + 'px'); // some offset to provide breathing room for hte tooltip
// based on the dimensions of the donut
tooltip.style('top', (d3.mouse(this)[1] + (height/5) + 'px'))
.style('left', (d3.mouse(this)[0] + (width/3) + 'px'));
}); });
legend = svg.selectAll('.legend') legend = svg.selectAll('.legend')

View File

@ -510,7 +510,7 @@
position: absolute; position: absolute;
text-align: center; text-align: center;
top: 85px; top: 85px;
width: 80px; width: 100px;
z-index: 10; z-index: 10;
color: white; color: white;
background-color: black !important; background-color: black !important;