chartjs / chartjs/Chart.js

Cannot use type: 'time' in scales x

Open
#12,017 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Expected behavior

No exception in the console

### Current behavior

I mam following [this example](https://www.chartjs.org/docs/latest/samples/scales/time-line.html)

using

```javascript
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_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.