Closed ianks closed 8 years ago
Anyone give this branch a whirl yet?
I've installed this branch to test out v2 functionality. So far everything works great for me.
Thanks for putting in that effort!
It's working great for me, too!
Works for me as well
Tested with Doughnuts and Pie charts. Works great!
@ianks can you make the changes mentioned in comments if you find them suitable? How can I assist?
I'll make the changes when I get home tomorrow.
Does the new combining feature in v2 work with these changes?
@russelldc I am not sure. I have not tested it. Can you give it a try?
Hi @russelldc, I'm using combined charts with this branch and it works properly.
Example:
It still does not work for me. Fix: in core.js
replace
var chartDataset = chart.data.datasets[setIndex];
for (var property in set) {
if (set.hasOwnProperty(property)) {
chartDataset[property] = set[property];
}
}
with
var chartDataset = {};
for (var property in set) {
if (set.hasOwnProperty(property)) {
chartDataset[property] = set[property];
}
}
chart.data.datasets[setIndex] = chartDataset;
I get this error using chartjs:2.1.6
core.js:60 Uncaught TypeError: (intermediate value)[chartType] is not a function
classData.initializeChart @ core.js:60
How do I install chart.js-v2 with npm to help with the testing ?
@nesbtesh add this to your package.json
"react-chartjs": "git+https://github.com/jhudson8/react-chartjs.git#chartjs-v2",
This resolves my issue posted in https://github.com/jhudson8/react-chartjs/issues/84
Essentially, only the data was being updated from the datasets. This PR makes its so all of the properties from the dataset are now assigned to the new chart. This will allow for things like:
It also re-introduces the
redraw
prop to force a re-render of the canvas.I have only tested this with the Line chart, so if anyone has any production apps where there make use of Doughnut charts, etc. please give this branch a whirl!