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
- Chartjs doughnut segment pattern
- Adding additional properties to a Chart JS dataset
- Chart js Datalabels styling
- Chartjs xaxis labels auto decrease disabled
- How to display date as label on x-axis in chart.js
- ChartJS doughnut legend click
- charts js grid line not removing
- So, I'm fetching my data from phpMyAdmin MySQL to the chart.js, but I need it with AJAX, but how AJAX works with Chart.js?
- Count the duplicates in a string array using React JS
- How to customize percentage label in Doughnutchart ng2 chart.js
- Why my buttons does not work?
- How can I create a long tail chart with chart.js
- React ChartJS prevent new data from being added into state after it's redrawn?
- How to use Chart.js in A-Frame?
- Callback after line chart rendered
- Chart.js doesn't animate on first load
- Bar Graph, chart.js PHP Will Not Load
- Graphs sharing datasets in chartjs
- Chart.js: Line displayed thinner than defined
- How to convert a bar legend to line legend in chart.js 2.7.2?
- How to parse data to graph in MVC
- Charts.Js with Asp.Net Webforms Does Not Work
- Set Global Config on Angular Charts Not Working
- Canvas size not changing
- Chart.js piechart, only have border on the outside of arc
- How to prevent first/last bars from being cut off in a chart with time scale
- How to get rid of the white square outline or border in the tooltip for chartjs?
- manipulate objects from inside a function
- Chartjs for Line chart, values on y-axis
- inject a bar chart into a webpage via content script