GithubHelp home page GithubHelp logo

Comments (3)

moh586 avatar moh586 commented on June 8, 2024

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

from laravel-chartjs.

abedputra avatar abedputra commented on June 8, 2024

Hi, any solution?

from laravel-chartjs.

abedputra avatar abedputra commented on June 8, 2024

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);.

from laravel-chartjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.