HumbleSoftware / Flotr2

Graphs and Charts for Canvas in JavaScript.
http://www.humblesoftware.com/flotr2/
MIT License
2.45k stars 528 forks source link

IE10 mouse track problem #235

Open test343 opened 11 years ago

test343 commented 11 years ago

If you have a "long" (long means vertical scroll do appear in the browser) content before chart you can not see mouse track tooltips if using IE10 (other browsers are ok).

See the full code as attachment (I don't know how to post html code in here!):

bug

cesutherland commented 11 years ago

Could you reproduce this in a fiddle?

http://jsfiddle.net/cesutherland/ZFBj5/

test343 commented 11 years ago

I don't understand what you mean but you can reproduce the bug very easily -- it's enough to insert a div with height 2000px and some fake data before chart container. In this case the result page will have vertical scroll and the chart will be at the bottom of the page and not visible till you scroll down. I posted the screenshot with full html code. I'm sorry but I don't understand how to post html code in this bug tracking system.

test343 commented 11 years ago

See the full code:

1

2013/8/14 Carl Sutherland notifications@github.com

Could you reproduce this in a fiddle?

http://jsfiddle.net/cesutherland/ZFBj5/

— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/235#issuecomment-22641200 .

test343 commented 11 years ago

Is it supposed to be fixed?

test343 commented 11 years ago

OK, I don't have time to wait when you fix it so I did it by myself :).

File flotr2.js line 2657:

//rx = e.clientX - r.left - plotOffset.left - b.scrollLeft - de.scrollLeft; rx = e.clientX - r.left - plotOffset.left - b.scrollLeft; //ry = e.clientY - r.top - plotOffset.top - b.scrollTop - de.scrollTop; ry = e.clientY - r.top - plotOffset.top - b.scrollTop;

Don't ask me why those changes: it just works! Tested with browsers: opera, chrome, ie 7-10, firefox

test343 commented 11 years ago

OK, I don't have time to wait when you fix it so I did it by myself :).

File flotr2.js line 2657:

//rx = e.clientX - r.left - plotOffset.left - b.scrollLeft - de.scrollLeft; rx = e.clientX - r.left - plotOffset.left - b.scrollLeft; //ry = e.clientY - r.top - plotOffset.top - b.scrollTop - de.scrollTop; ry = e.clientY - r.top - plotOffset.top - b.scrollTop;

Don't ask me why those changes: it just works! Tested with browsers: opera, chrome, ie 7-10, firefox

2013/8/14 Carl Sutherland notifications@github.com

Could you reproduce this in a fiddle?

http://jsfiddle.net/cesutherland/ZFBj5/

— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/235#issuecomment-22641200 .

cesutherland commented 11 years ago

Thanks for digging. I'll figure out why and get this integrated :-)

On Thu, Aug 15, 2013 at 3:04 PM, test343 notifications@github.com wrote:

OK, I don't have time to wait when you fix it so I did it by myself :).

File flotr2.js line 2657:

//rx = e.clientX - r.left - plotOffset.left - b.scrollLeft - de.scrollLeft; rx = e.clientX - r.left - plotOffset.left - b.scrollLeft; //ry = e.clientY - r.top - plotOffset.top - b.scrollTop - de.scrollTop; ry = e.clientY - r.top - plotOffset.top - b.scrollTop;

Don't ask me why those changes: it just works! Tested with browsers: opera, chrome, ie 7-10, firefox

— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/235#issuecomment-22722095 .

sergolius commented 10 years ago

Hey, i found same bug at Chrome ;( If chart placed not at top of the page, and window of browser is scrolled, thats scroll value create trouble. It's breake mouse tracking by adding scroll value to mouse coordinates ((((

I find, that IE and FF return zero (0), for 'scrollTop' of 'body'.

File flotr2.js line 2657: rx = e.clientX - r.left - plotOffset.left - (b.scrollLeft || de.scrollLeft); ry = e.clientY - r.top - plotOffset.top - (b.scrollTop || de.scrollTop);

p.s. Sorry my english