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 use type: 'time' in scales x #12017

Open
blackat opened this issue Feb 2, 2025 · 2 comments
Open

Cannot use type: 'time' in scales x #12017

blackat opened this issue Feb 2, 2025 · 2 comments

Comments

@blackat
Copy link

blackat commented Feb 2, 2025

Expected behavior

No exception in the console

Current behavior

I mam following this example

using

scales: {
      x: {
        // HERE WHAT CAUSE THE ISSUE
        type: 'time',
        time: {
          // Luxon format string
          tooltipFormat: 'DD T'
        },
        title: {
          display: true,
          text: 'Date'
        }
      },
      y: {
        title: {
          display: true,
          text: 'value'
        }
      }
    },
  },

ERROR Error: This method is not implemented: Check that a complete date adapter is provided.
at abstract (chart.js:2631:9)
at _DateAdapterBase.formats (chart.js:2660:12)
at TimeScale.init (chart.js:11571:42)
at chart.js:5881:13
at each (helpers.segment.js:101:12)
at Chart.buildOrUpdateScales (chart.js:5859:5)
at Chart._updateScales (chart.js:6024:10)
at Chart.update (chart.js:5975:10)
at new Chart (chart.js:5742:12)
at primeng-chart.mjs:118:22

Reproducible sample

https://www.chartjs.org/docs/latest/samples/scales/time-line.html

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

No response

chart.js version

4.4.7

Browser name and version

No response

Link to your project

No response

@LeeLenaleee
Copy link
Collaborator

As described in the docs here a date adapter is required for the time scale to work:
https://www.chartjs.org/docs/latest/axes/cartesian/time.html#date-adapters

@blackat
Copy link
Author

blackat commented Feb 8, 2025

Thanks, I will try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants