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

Cannot add date adapter #8

Open
jcapogna opened this issue Feb 20, 2023 · 2 comments
Open

Cannot add date adapter #8

jcapogna opened this issue Feb 20, 2023 · 2 comments

Comments

@jcapogna
Copy link

I migrated my CoreUI project from v3 to v4.

CoreUI updated Chart.JS to v3 which requires date adapters for time data: https://www.chartjs.org/docs/3.9.1/axes/cartesian/time.html#date-adapters

I have been unsuccessful at getting these date adapters to work properly. I've tried several adapters and I keep getting the following error:
Uncaught Error: This method is not implemented: Check that a complete date adapter is provided.

I think this has something to do with CoreUI's loading of Chart.JS. I believe the error implies that Chart.JS has not loaded yet when the data adapter is loaded, but I'm not sure on that.

In any case, I found evidence that someone else ran into this problem: https://stackoverflow.com/a/74710838/1332811

I have been able to use date adapters with Chart.JS by using react-chartjs-2 instead of coreui-react-chartjs, so I think there is something wrong with the CoreUI implementation that prevents date adapters from working.

@mrholek
Copy link
Member

mrholek commented Feb 23, 2023

@jcapogna Can you show me your code?

@danielblnc
Copy link

Same issue.

scales: {
    x: {
        type: 'time',
        time: {
            unit: 'hour',
            stepSize: 1,
        },
        ticks: {
            source: 'auto',
        }
    }
}

Anything that uses type: 'time' causes the error.

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

3 participants