radar-chart-d3
radar-chart-d3 copied to clipboard
Fix for tooltip variable usage
Tooltips are not rendered correctly because there are multiple problems with the tooltip variable:
- There is a typo "toolip" in src/radar-chart.js@29
- setTooltip uses the closure tooltip, which is created in chart. The problem is that if you reuse the graph as shown in the README example, all the graph instances share the same tooltip variable. So the last value set is the one used.
This PR does a small correction in setTooltip, there is also another issue inside that function (the y variable in src/radar-chart.js@38 is declared global by mistake :(
I would recommend to add jshint to catch those errors, and to enclose RadarChart with a function to 'use strict' and avoid those hard to find problems. I'll do it in a future PR, however the change is not so small and merging will require more eyes.