You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
Can anyone spot anything that I have done wrong? I have also noticed that the label in the datasets object are not showing. My guess is that is down to the version of Chart JS
Reacted by Tom Nolan, Paul Fitzgerald, Ashutosh Kumar Jha, Yoaquim Cintrón, pavlo-koval, William Dibbern, ubermensh, Shivshankar Pindoriya and Robert Sutherland
Switching to v2 did nothing for me either, I just got more errors with that. I created my own simple Chart component using the ChartJS library to see if anything changes here.
I switched to https://github.com/gor181/react-chartjs-2 and solved all my issues - both options not being picked up and charts not being resized. If I had more time i'd investigate what was going on.
Reacted by William Dibbern, Jordan Place and Andrew Chan
I had the same problem, but after switching into chartjs v.2 everything work fine,
try this commands:
npm install --save chart.js@^2 react react-dom
npm install -S react-chartjs@git://github.com/reactjs/react-chartjs.git#chartjs-v2
Reacted by Andrew Chan, Thomas VIAL and wajeehafathima
Activity
janakact commentedon Nov 22, 2016
I have a similar problem too.
tsnolan23 commentedon Nov 22, 2016
I'm also experiencing the same issue.
ChartsJs v1.1.1
React ChartJs v0.8.0
janakact commentedon Nov 23, 2016
@tsnolan23
Check this out #134
Switching to chartJs v2 solved the problem.
zacharybrady commentedon Dec 2, 2016
Anyone able to solve this? Switching to v2 did nothing for me.
zacharybrady commentedon Dec 2, 2016
Actually, switch to v2 broke my project and now that I'm trying to switch back the charts aren't appearing.
tsnolan23 commentedon Dec 2, 2016
Switching to v2 did nothing for me either, I just got more errors with that. I created my own simple Chart component using the ChartJS library to see if anything changes here.
tsnolan23 commentedon Dec 2, 2016
@zacharybrady If you look at the docs for ChartJS, they actually note to different React libraries:
http://www.chartjs.org/docs/#notes-popular-extensions
Maybe one of those could help you.
zacharybrady commentedon Dec 2, 2016
@tsnolan23 Unfortunately I'm getting the same error which seems to be something between ChartJS2 and either Webpack or Babel.
zacharybrady commentedon Dec 2, 2016
Also to note. I'm using both a Doughnut Chart and a Bar Graph. Options work perfectly for the doughnut chart but not for the bar graph.
nikcub commentedon Dec 6, 2016
I switched to https://github.com/gor181/react-chartjs-2 and solved all my issues - both options not being picked up and charts not being resized. If I had more time i'd investigate what was going on.
pavlo-koval commentedon Dec 20, 2016
I had the same problem, but after switching into chartjs v.2 everything work fine,
try this commands:
npm install --save chart.js@^2 react react-dom
npm install -S react-chartjs@git://github.com/reactjs/react-chartjs.git#chartjs-v2
gazofnaz commentedon Feb 12, 2017
v1.1.1 has a completely different syntax for setting the options: https://github.com/chartjs/Chart.js/blob/v1.1.1/docs/01-Line-Chart.md
That's why what is posted is not working.
tomav commentedon May 29, 2017
@nikcub and @PashaKoval worked for me. Thanks guys.
Jareechang commentedon Jan 14, 2018
closing issue.
rfarney3 commentedon May 9, 2018
You have to pass the options object in just as you would pass the data. For example, I have
`const data = {
labels: ["Anger", "Joy", "Fear", "Surprise", "Sadness"],
AAAAAAND I have
const options = { scales: { yAxes: [{ ticks: { beginAtZero: true, fontSize: 16 } }], xAxes: [{ ticks: { beginAtZero: true, fontSize: 16 } }] } }And I am rendering them by calling
<Line data={data} options={options} />