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

Strip random data and replace with my own #121

Open
ackmiecik opened this issue Feb 8, 2022 · 1 comment
Open

Strip random data and replace with my own #121

ackmiecik opened this issue Feb 8, 2022 · 1 comment

Comments

@ackmiecik
Copy link

Are there any instructions available that show how to replace the random data code with my own code?
eg. a MySQL table, PHP array...

@msj121
Copy link

msj121 commented Mar 3, 2022

I think that it is kind of agnostic how you get your data. Once you have it simply call:

const myChart = new Chart(ctx, {
        type: 'candlestick',
        data: {
            datasets: [{
                label: 'Stock Data',
                data: []
            }]
        }
    });
myChart.config.data.datasets = [{label:"stock",data:yourData}];
myChart.update();

The data does need to be formatted properly, but other then that you can do an http request to get the data from your data source or whatever api your using. I hope this was helpful

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

2 participants