Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bar chart broken when using Chart.js 2.9.0+ and using tooltip #6

Open
markokimpel opened this issue Jan 18, 2021 · 0 comments
Open

Comments

@markokimpel
Copy link

Steps to repeat:

When using Chart.js 2.9.0 (or the latest 2.9.4) a JavaScript error is thrown when hovering over a bar and the chart remains in a white-ish color.

I did some digging:

  • In chartjs-plugin-rough.js, RoughTooltip>drawBody>ctx.fillRect and ctx.StrokeRect 'options.fillOptions' and 'options.strokeOptions' are accessed. This is where the error occurs.
  • Variable 'options' is updated in the customized 'helpers.each'. The logic expects Chart.js to use helper.each to iterate. Chart.js is not using that method in that place anymore.

drawBody in Chart.js 2.8.0:
// Draw body lines now
helpers$1.each(body, function(bodyItem, i) {

drawBody in Chart.js 2.9.0:
// Draw body lines now
for (i = 0, ilen = body.length; i < ilen; ++i) {
bodyItem = body[i];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant