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

React chart JS requires moment.js #179

Closed
MaxiMacko opened this issue Aug 14, 2017 · 2 comments
Closed

React chart JS requires moment.js #179

MaxiMacko opened this issue Aug 14, 2017 · 2 comments

Comments

@MaxiMacko
Copy link

Hello. I've faced an issue with connecting react-chartjs-2 lib to my project. When I try to render a simple Line chart with such data:

const testData = { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 159, 64, 0.2)' ], borderColor: [ 'rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)', ], borderWidth: 1, }], };

I receive a warning about "Module not found: Error: Can't resolve './locale' in /node_modules/moment/src/lib/locale". I don't need moment.js in my project and this warning has never occured before I started to use react-chartjs-2. How can I disable it if it possible? Thank you.

@tusbar
Copy link
Contributor

tusbar commented Aug 22, 2017

Chart.js itself depends on moment – so yes, react-chartjs-2 does too.

See chartjs/Chart.js#4303.

@jerairrest
Copy link
Collaborator

Good call @tusbar. Closing.

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

3 participants