youcef92 / flotr

Automatically exported from code.google.com/p/flotr
0 stars 0 forks source link

Problems with mouse tracking: drawHit assumes y's min to be 0 - patch included #141

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. open basic-bar.html on your editor
2. change y axis' min to, say, 0.5
3. hover over the bars

What is the expected output? What do you see instead?

Notice that the bars' highlights extend below the chart.

What version of the product are you using? On what operating system?

SVN revision 169

Please provide any additional information below.

I think a better solution is to use this.axes.y.min -- see the attached patch.

Original issue reported on code.google.com by dennis.s...@gmail.com on 17 Aug 2010 at 12:05

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The above is for the Prototype implementation, and is related to issue 68.

Btw, I just realized that the patch won't work for drawing hits for bars that 
are using y2 axis when those bars are taller than those of y1's.

Original comment by dennis.s...@gmail.com on 17 Aug 2010 at 4:32

GoogleCodeExporter commented 8 years ago
Thank you !
Would you be able to fix the patch so that it works for y2 too ?

Original comment by fabien.menager on 17 Aug 2010 at 11:51

GoogleCodeExporter commented 8 years ago
Sure thing, I'll look into it once I have the chance again.

Original comment by dennis.s...@gmail.com on 17 Aug 2010 at 7:44

GoogleCodeExporter commented 8 years ago
There were a couple of things that needed fixing:
1. hit function assumed x1 and y1
2. drawHit assumed that y's minimum value is 0--therefore it's in important to 
set the min value to something other than 0 to reproduce this bug (see the 
steps above)

Solving the first problem requires checking for the axis number related to the 
series, and then use the right axis. And fixing the second one simply uses the 
minimum value of the aforementioned axis. Please see the attached patch. 

Let me know what you think.

Original comment by dennis.s...@gmail.com on 18 Aug 2010 at 1:02

Attachments:

GoogleCodeExporter commented 8 years ago
I'm deleting my first erroneous patch.

Original comment by dennis.s...@gmail.com on 18 Aug 2010 at 1:03

GoogleCodeExporter commented 8 years ago
I found one major problem with your patch. Just setting ya.d2p(ya.min) its not 
good idea while it dont work if there are any negative values for bars.

Original comment by macku30@gmail.com on 18 Aug 2010 at 7:02

GoogleCodeExporter commented 8 years ago
Try rather something like this  y.min<0? 0 : y.min

Original comment by macku30@gmail.com on 18 Aug 2010 at 7:07

GoogleCodeExporter commented 8 years ago
Yep, you're right, macku30. The better solution is to use "ya.min<0? 0 : 
ya.min", not ya.min. I just gave it a try, and it works great.

Original comment by dennis.s...@gmail.com on 18 Aug 2010 at 4:55

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r188.

Original comment by macku30@gmail.com on 8 May 2011 at 11:46