PMSI-AlignAlytics / dimple

An object-oriented API for business analytics
Other
2.73k stars 556 forks source link

Wrong negative values in mousemove event (bar chart) #204

Open TFrascaroli opened 8 years ago

TFrascaroli commented 8 years ago

I implemented a custom tooltip for a bar chart we've built using dimple. Everything worked fine untill we started having negative values. The bars get correctly drawn, but when we hovered on them we would see value 0. This is what we're using to get the value of the data, inside the event handler for mousemove: evt.yValue where evt is the event (first parameter) passed to the handler by dimple.

If we look at the file "/src/objects/chart/methods/_registerEventHandlers.js", we find that this is being constructed like this: e.yValue = d.y; on line 16 of said file. The thing is, in my opinion, it should be: e.yValue = d.yValue;

I'm not creating a pull request for this since I'm not sure this is the correct way to ensure we get the right value when hovering. Perhaps adding an extra property to the e object would do the trick. We've modified our copy of dimple including this tweak, but please let me know if this is the right way, or even if I'm wrong in my assumptions and this is to be dealt with in some other manner.

Thank you.