GithubHelp home page GithubHelp logo

Comments (11)

Koshux avatar Koshux commented on August 24, 2024

Bumping this issue.

from chartjs-plugin-zoom.

Koshux avatar Koshux commented on August 24, 2024

@etimberg ping

from chartjs-plugin-zoom.

compwright avatar compwright commented on August 24, 2024

@Koshux the industry seems to be moving away from RequireJS towards newer and better technologies like Webpack. Given that there are other ways to make this work, this particular issue isn't really at the top of the priority scale--this plugin has much bigger issues with functionality, as you can see from the issues list. If you need this fixed now, please consider submitting a PR. Thanks!

from chartjs-plugin-zoom.

simonbrunel avatar simonbrunel commented on August 24, 2024

@Koshux I'm curious to know if this issue also happens with the chartjs-plugin-deferred plugin?

from chartjs-plugin-zoom.

simonbrunel avatar simonbrunel commented on August 24, 2024

@Koshux can you try with these files: chartjs-plugin-zoom.zip

from chartjs-plugin-zoom.

Koshux avatar Koshux commented on August 24, 2024

@simonbrunel I have tried using both files provided in the ZIP file (chartjs-plugin-zoom.js & chartjs-plugin-zoom.min.js) and still encounter the same issue. The working solution is to change the expected module ID from 'require('chart.js')' to 'require('chartjs')'.

from chartjs-plugin-zoom.

simonbrunel avatar simonbrunel commented on August 24, 2024

Can you share test cases that fail to load chart.js and another one that work with chartjs?

from chartjs-plugin-zoom.

simonbrunel avatar simonbrunel commented on August 24, 2024

Also, if chart.js is renamed to chartjs, how this will work with other module loaders?

from chartjs-plugin-zoom.

 avatar commented on August 24, 2024

Bumbing this up since this is a breaking issue with requirejs.

from chartjs-plugin-zoom.

jbsgh avatar jbsgh commented on August 24, 2024

My require.config.js looks like this:

require.config({
	paths: {
		moment: 'lib/moment.js/moment-with-locales.min',
		chartjs: 'lib/chart.js/Chart'
	},
	map: {
		'*': {
			'chart.js': 'chartjs'
		}
	},
	shim: {
		'chartjs': {
			deps: ['moment']
		}
	}
});

The trick is to map the module-name "chart.js" including the .js-suffix to the module-name "chartjs". This configuration allows RequireJS to load chart.js-plugins without any modification.

from chartjs-plugin-zoom.

mortac8 avatar mortac8 commented on August 24, 2024

I fought with this for hours when trying to use the dragdata extension. I ended up doing the following at the top of my js class to ensure chartjs (2.9.3) is loaded before the dragdata (1.0.2) extension.

require.config({
    shim: {
        "myapp/js/chartjs/chartjs-plugin-dragdata": ["myapp/js/chartjs/Chart"]
    }
});

from chartjs-plugin-zoom.

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.