New contributions to the library are welcome, but we ask that you please follow these guidelines:
- Use tabs for indentation, not spaces.
- Only change the individual files in
- Check that your code will pass
gulp lintwill run this for you.
- Check that your code will pass tests,
gulp testwill run tests for you.
- Keep pull requests concise, and document new functionality in the relevant
- Consider whether your changes are useful for all users, or if creating a Chart.js plugin would be more appropriate.
- Avoid breaking changes unless there is an upcoming major release, which are infrequent. We encourage people to write plugins for most new advanced features, so care a lot about backwards compatibility.
Joining the project
Active committers and contributors are invited to introduce yourself and request commit access to this project. We have a very active Slack community that you can join here. If you think you can help, we'd love to have you!
Building and Testing
Firstly, we need to ensure development dependencies are installed. With node and npm installed, after cloning the Chart.js repo to a local directory, and navigating to that directory in the command line, we can run the following:
> npm install > npm install -g gulp
The following commands are now available from the repository root:
> gulp build // build Chart.js in ./dist > gulp unittest // run tests from ./test/specs > gulp unittest --watch // run tests and watch for source changes > gulp unittest --coverage // run tests and generate coverage reports in ./coverage > gulp lint // perform code linting (ESLint) > gulp test // perform code linting and run unit tests > gulp docs // build the documentation in ./dist/docs
More information can be found in gulpfile.js.
Bugs and Issues
Please report these on the GitHub page - at github.com/chartjs/Chart.js. Please do not use issues for support requests. For help using Chart.js, please take a look at the
chartjs tag on Stack Overflow.
Well structured, detailed bug reports are hugely valuable for the project.
Guidelines for reporting bugs:
- Check the issue search to see if it has already been reported
- Isolate the problem to a simple test case
- Please include a demonstration of the bug on a website such as JS Bin, JS Fiddle, or Codepen. (Template)
Please provide any additional details associated with the bug, if it's browser or screen density specific, or only happens with a certain configuration or data.