fixed issue with chart-label vertical position
This commit is contained in:
parent
818e4b315a
commit
88f11d4322
@ -1225,16 +1225,23 @@ export default class TbFlot {
|
|||||||
|
|
||||||
if (tooltipHtml) {
|
if (tooltipHtml) {
|
||||||
tbFlot.ctx.tooltip.html(tooltipHtml)
|
tbFlot.ctx.tooltip.html(tooltipHtml)
|
||||||
.css({top: pageY+5, left: 0})
|
.css({top: 0, left: 0})
|
||||||
.fadeIn(200);
|
.fadeIn(200);
|
||||||
|
|
||||||
var windowWidth = $( window ).width(); //eslint-disable-line
|
var windowWidth = $( window ).width(); //eslint-disable-line
|
||||||
|
var windowHeight = $( window ).height(); //eslint-disable-line
|
||||||
var tooltipWidth = tbFlot.ctx.tooltip.width();
|
var tooltipWidth = tbFlot.ctx.tooltip.width();
|
||||||
|
var tooltipHeight = tbFlot.ctx.tooltip.height();
|
||||||
var left = pageX+5;
|
var left = pageX+5;
|
||||||
|
var top = pageY+5;
|
||||||
if (windowWidth - pageX < tooltipWidth + 50) {
|
if (windowWidth - pageX < tooltipWidth + 50) {
|
||||||
left = pageX - tooltipWidth - 10;
|
left = pageX - tooltipWidth - 10;
|
||||||
}
|
}
|
||||||
|
if (windowHeight - pageY < tooltipHeight + 20) {
|
||||||
|
top = pageY - tooltipHeight - 10;
|
||||||
|
}
|
||||||
tbFlot.ctx.tooltip.css({
|
tbFlot.ctx.tooltip.css({
|
||||||
|
top: top,
|
||||||
left: left
|
left: left
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user