score:0
I think you should put list in x like below code.
scales: {
x: [{
type: 'time'
}]
}
score:1
This answer comes a bit late but for everyone who stumbles here: You need a date adapter. Find a full list here
Once you installed i.e. date-fns via npm install date-fns chartjs-adapter-date-fns --save
in your root directory you have to do two things to make it work in your React project:
- Add this at the top of your file
import 'chartjs-adapter-date-fns';
andimport { enUS } from 'date-fns/locale';
- Inside your options:
options = {
...
scales: {
x: {
type: 'time',
// add this:
adapters: {
date: {
locale: enUS,
},
},
}
},
...
}
score:3
As stated in your error and the documentation you need an adapter to convert the dates to date objects, see documentation: https://www.chartjs.org/docs/latest/axes/cartesian/time.html#date-adapters
score:7
You need an adaptor as stated above. Look here: https://github.com/chartjs/chartjs-adapter-date-fns
One option is to add the following cdn links.
<script src="https://cdn.jsdelivr.net/npm/chart.js/dist/chart.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
score:13
You need to install and import an adapter, in your case it's moment adapter for time series
npm install moment chartjs-adapter-moment --save
then import it in your component:
import 'chartjs-adapter-moment';
for more info about adapters, check this
Source: stackoverflow.com
Related Query
- TimeSeries scale in ChartJS 3.0.2. brings error "This method is not implemented: either no adapter can be found or an incomplete integration was ..."
- 'require is not defined' error when attempting to use chartjs in javascript code
- react-chartjs-2 with chartJs 3: Error "arc" is not a registered element
- chartjs + Angular6 is not showing charts or any error
- Chartjs not rendering chart and no error thrown
- Chartjs destroy method not affecting the chart
- Chartjs not working with d3 from csv source
- I am having this error in charts v3 chartjs-chart-treemap: fontColor does not exist in type 'ChartDataset<"treemap", TreemapDataPoint[]>
- ChartJs beforeDraw method not getting called in release build
- ChartJS on NodeJS: error Chart is not defined
- Why is this chartjs graph not being loaded? (Using Vue.js)
- Reproduce Error in Chartjs v2 Polar chart not plotting all supplied data
- ChartJs not working with this JSON Object
- My Chartjs is not updating after setstate full code attached Reactjs Update
- why i have this error Utils is not defined when i want create a chart from chart.js
- Chart.js core.js:6162 ERROR Error: "line" is not a registered controller
- Error: "category" is not a registered scale
- ReferenceError: Chart is not defined - chartjs
- Why does nuxt give me this error with vue-chartjs?
- ChartJs title not showing
- core.js:4197 ERROR TypeError: chart_js__WEBPACK_IMPORTED_MODULE_2__ is not a constructor
- How to make integer scale in Chartjs
- ChartJS canvas not displaying rgba colors in IE, Safari and Firefox
- chartjs : how to set custom scale in bar chart
- Chartjs displays numbers not time
- show label in tooltip but not in x axis for chartjs line chart
- chart.js not allowing y axis steps with logarithmic scale
- chartjs height does not follow parent container
- Chart.js chart.update() method is not doing anything
- Category scale on Y-axis and time on x-axis in bubble chart in Chartjs
More Query from same tag
- Chart js Datalabels styling
- Bars of my chartjs chart has no background color
- Multi- Line title in chart.js not working
- How to get values inside a chart without clicking
- Can i set dynamic step size on stepped line chart in chart.js?
- Can't get Chart.js to run in a Vue.js component
- Data with pair X and Y values
- Learning Chartjs .destroy()
- How to populate a charts.js pie chart using json array
- chart.js plugins.register function with outer data
- How can I build a vertical line without going through my dots on my line graph? (charts.js)
- Highlight date in Chart.js line graph
- Height for chart area (not the canvas size)?
- Rotate 90 degrees clockwise the scaleLabel (no ticks or labels) on a Chart.js line chart
- Scrollable x axis with chart.js 2.1.4
- How to push datasets dynamically for chart.js (bar chart)?
- Legend for only specific datasets - chart.js
- Having issues with running npm start after installing chartjs
- [Chart.js]How can I prevent my chart from drawing beyond it's min time?
- How to push Firestore data to ChartJS?
- Convert charts from vue-chartjs to a PDF
- Chart.js - Vertical crosshair (vertical annotation that moves with mouse) in line graph
- Chart.js - Uncaught ReferenceError: chart is not defined
- ChartJS - Override Attributes (AngularJS)
- change stroke line color in chart according to datasets in react native
- How to sum array value in chart.js inside loop function?
- Chart.js Plugin Not Recognized as Options Property in Angular
- Performance issue, what causes it?
- Chartjs ignore values and draw chart
- How to increase Chart.js yAxes' height to prevent overlapping