GithubHelp home page GithubHelp logo

Comments (7)

gregh3269 avatar gregh3269 commented on May 18, 2024 4

v3.1.0 I get
Uncaught TypeError: Chart.defaults.global is undefined
/**

  • Plugin based on discussion from Chart.js issue #2745.
  • @see chartjs/Chart.js#2745
    */
    Chart.defaults.global.plugins.deferred = {
    xOffset: 0,
    yOffset: 0,
    delay: 0
    };

Cheers

from chartjs-plugin-deferred.

gregh3269 avatar gregh3269 commented on May 18, 2024 1

Would be good to get this fixed as @2.9.4 is the last version plug-in works on.

from chartjs-plugin-deferred.

john-rock avatar john-rock commented on May 18, 2024

Chartjs version: 3.3.2
Plugin version: 1.0.2

I'm getting - e.defaults.global is undefined

from chartjs-plugin-deferred.

cysieks avatar cysieks commented on May 18, 2024

I was able to make it work with chart js 3:
Here is fork: https://github.com/cysieks/chartjs-plugin-deferred

from chartjs-plugin-deferred.

gregh3269 avatar gregh3269 commented on May 18, 2024

@cysieks great, works now, but load does not seem to be deferred and loads immediately? (rechecked)

from chartjs-plugin-deferred.

mloit avatar mloit commented on May 18, 2024

The parameter lists for the beforeInit, and beforeDatasetsUpdate are incorrect. As coded they are (chart, options), but they need to be (chart, args, options) for the options to be seen, without it it is defaulting to 0 because it thinks they are undefined.. Changing that seems to have made it work for me. I had to make some other changes to get it to load, but once i did that, it all seems to work now. @cysieks thanks for the fork!

I'm still chasing down another issue. Using the plugin seems to trigger an onComplete event for the chart immediately on load, which causes a problem for me as I have some other code dependent on that event happening when the chart is drawn. But thanks to this fork, things are moving forward.

from chartjs-plugin-deferred.

simonbrunel avatar simonbrunel commented on May 18, 2024

Version 2.0.0-beta.1 has been released and is compatible with Chart.js v3.

from chartjs-plugin-deferred.

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.