Open Naveedali1234 opened 6 years ago
Hello fxcosta and thank you so much for the amazing work.
actually this library is working perfectly when i return the $chartjs object from controller to view directly and render it there, but i am now doing it through ajax call, i have the chartjs object ready there in controller and return the object from the controller function to the ajax call success function, but how do i render in the success function of ajax call? your help would be really appreciated.
thank you
hi.do you find a solution for your problem?i have same problem
Hi, any solution?
I found a solution. I try to implement some functions like this. After calling the ajax, we will add the data from ajax to update our Chart with this function
function addData(chart, data, datasetIndex) {
chart.data.datasets[datasetIndex].data = data;
chart.update();
}
function addLabel(chart, label) {
chart.data.labels = label;
chart.update();
}
This is an example addData(chart, newData, 0);
or addLabel(chart, newLabel);
.
Hello fxcosta and thank you so much for the amazing work.
actually this library is working perfectly when i return the $chartjs object from controller to view directly and render it there, but i am now doing it through ajax call, i have the chartjs object ready there in controller and return the object from the controller function to the ajax call success function, but how do i render in the success function of ajax call? your help would be really appreciated.
thank you