krzysu / flot.tooltip

tooltip plugin for wonderful Flot plotting library
https://github.com/krzysu/flot.tooltip
187 stars 153 forks source link

Cannot read property 'cssClass' of undefined #136

Closed justinbwarner closed 8 years ago

justinbwarner commented 8 years ago

Getting an error with version 0.8.6 that didn't happen in 0.8.5. Created a plunker that reproduces the issue:

https://embed.plnkr.co/snAKVOxXDSEobEdr81WK/

Cannot read property 'cssClass' of undefined at FlotTooltip.getDomElement (jquery.flot.tooltip.js:329) at Plot.FlotTooltip.init.plot.removeTooltip (jquery.flot.tooltip.js:320) at jquery.flot.tooltip.js:116 at executeHooks (jquery.flot.js:717) at Plot.shutdown (jquery.flot.js:1363) at setupCanvases (jquery.flot.js:1327) at new Plot (jquery.flot.js:707)

krzysu commented 8 years ago

I see there was an API change, and backwards compatibility is not written perfectly ;)

just try using new configuration object:

instead of

tooltip: true,
tooltipOpts: {
    content: "%s %x, %y"
}

use

tooltip: {
    show: true,
    content: "%s %x, %y"
}

let me know if it helps!

loren138 commented 8 years ago

This error seems to occur if you have flot.tooltip.js installed, but do not have tooltips turned on for a particular graph. (ie show: false or no tooltip config at all)

Also, this is a 2.8.X release it should have no new features or API changes only bug fixes. A backwards breaking change should only occur in an X.0.0 release so those of us who automatically pull in bugfix release don't end up with broken projects.

krzysu commented 8 years ago

I agree with breaking changes and versioning, unfortunately I'm not an active maintainer of this repo, talk with @Roundaround

po5i commented 8 years ago

Seems that can be fixed with #138

krzysu commented 8 years ago

138 merged and released as 0.8.7, let me know if everything is fine