Hi,I am using igDataChart inside a igDialog window that opens external page, so essentially the chart is inside an iframe window.My problem is with the tooltip position when hovering on the columns that are close to the right edge of the dialog.The tooltip always opens to the right so the tooltip for the right columns is being cut and is unreadable to the user.
attached are two printscreens of the chart that shows the problem.printScreen1.png - is the tooltip as it should beprintScreen2.png - is the tooltip being cut
Is there anyway to control the tooltip position - this is item tooltip for the chart
Thanks for your help
Thanks Mike,
works as expected.
I changed a bit your function, so the tooltip will be left (or above) of the cursor because the way you implemented it, it was sometimes hiding the datapoint that the cursor was pointing at.
My implementation of the function :
function handleMouseMove(event) {
var tooltip = $('#2015Population_tooltip'); //'2015Population' is the series' name if (tooltip[0]) { tooltip.css({ 'white-space': 'nowrap' }); var $window = $(window); var wWidth = $window.width(); var wHeight = $window.height(); var width = tooltip.outerWidth(true); var height = tooltip.outerHeight(true); var left = tooltip.position().left; var top = tooltip.position().top;
if (width + left > wWidth) { var wlimit = event.clientX - width; tooltip.css({ left: wlimit + 'px' }); } if (height + top > wHeight) { var hlimit = event.clientY - height; tooltip.css({ top: hlimit + 'px' }); }
}
Thanks again
Hello Amos_silberman,
I have spoken with our development team and as a workaround you can attach the following event/method to the mouse move event:
// atach for mouse move event
document.onmousemove = handleMouseMove;
function handleMouseMove(event) { var tooltip = $('#2015Population_tooltip'); //'2015Population' is the series' name if (tooltip[0]) { var $window = $(window); var wWidth = $window.width(); var width = tooltip.outerWidth(true); var left = tooltip.position().left; if (width + left > wWidth) { var limit = wWidth - width; tooltip.css({ left: limit + 'px' }); } } }
var tooltip = $('#2015Population_tooltip'); //'2015Population' is the series' name
if (tooltip[0]) {
var $window = $(window);
var wWidth = $window.width();
var width = tooltip.outerWidth(true);
var left = tooltip.position().left;
if (width + left > wWidth) {
var limit = wWidth - width;
tooltip.css({ left: limit + 'px' });
I am also attaching a modified version of your sample to demonstrate this behavior.
Hello,
Is there any update on the issue? Customers are keep asking me for answers..
is there any workaround?
Hi,
Is there any update on the issue?It was not solved for new 14.2 version.
Is there any way i can override the tooltip position myself?
Jquery UI position api has the collision attribute to handle such cases
see also http://css-tricks.com/collision-detection/
Thanks
Thanks for your help Joe,
looking forward for any updates on the issue.