Git Product home page Git Product logo

Comments (3)

andrewaarestad avatar andrewaarestad commented on May 26, 2024

I came across this issue due to using chartjs-node-canvas which sets animation to false automatically. Scatter chart error bars aren't showing up, but bar chart error bars work.

Stepping through the code, it looks like the issue is that for scatter and line plots, chart.js has a "directUpdate" mode that gets used when animation is disabled. In this mode, it does not call updateElement() on each element, which results in the custom properties e.g. xMin, xMax not getting transferred from the parsed data objects to the PointWithErrorBar objects.

If I manually disable directUpdate using a step debugger, I was able to get a chart to render with error bars. However I can't figure out a way to prevent directUpdate from being set by changing any configuration. Even if I alter the chartjs-node-canvas library to set animation: true, chart.js will override it, since it detects you aren't in a DOM platform.

So I'm not sure if this can be addressed by a change to the chartjs-chart-error-bars module. I might try forking chart.js and adding an option to disable directUpdate, I think that would probably work.

from chartjs-chart-error-bars.

andrewaarestad avatar andrewaarestad commented on May 26, 2024

I can confirm the error bars on scatter plots are working now in 3.8.0. Thank you @sgratzl !!

from chartjs-chart-error-bars.

mossymaker avatar mossymaker commented on May 26, 2024

Thanks, @sgratzl! ✨

from chartjs-chart-error-bars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.