score:3
Accepted answer
this also won't work in normal is, this is because your scale config is in v2 style while you are using v3.
in v3 every scale is its own object where the key is the scale id so there are no more arrays. changing your config to this will make it work:
options: {
scales: {
x: {
type: 'time'
}
}
}
edit:
you also need to import and register the time scale and not the category scale for the x axis.
import {
chart as chartjs,
timescale, //import timescale instead of category for x axis
linearscale,
pointelement,
lineelement,
title,
tooltip,
legend
} from "chart.js";
import { chart } from "react-chartjs-2";
chartjs.register(
timescale, //register timescale instead of category for x axis
linearscale,
pointelement,
lineelement,
title,
tooltip,
legend
);
Source: stackoverflow.com
Related Query
- Time Series Line chart js in react not working
- Time series line chart is not displayed
- Click event of stacked line chart not working
- Stacked line chart not displaying correctly when Xaxis is time
- Chart.js Date and Time Bar Chart Not Rendering - Line Works Though
- how can i use chart.js to create a chart that has one time series line and one linear line on it at the same time?
- ChartJS not showing data for time series bar chart
- ChartJS autoskip:False not working on line chart
- Tooltip callbacks in line chart JS not working
- angular chart js type line setting chart-options not working
- show label in tooltip but not in x axis for chartjs line chart
- Chart JS - set start of week for x axis time series
- Angular-chart.js - Make line chart does not curve
- Can't get bar chart colors in Chart js working in React Js
- angular-chartjs line chart TypeError: t.merge is not a function
- Chart.js line chart is not displaying
- How can I create a time series line graph in chart.js?
- AutoSkip: False not working on time xAxes labels
- Line chart is not being displayed in Chart.js
- Series Details Not Showing in Angular Chart with Charts.js
- chartjs-plugin-zoom not working with my React project
- showing tooltips all the time in chartjs 2.4 not working
- ChartJS - radar chart options not working
- Bubble Chart in Chartjs not working
- Chart.js tooltip not showing on line chart
- annotation line not visible in scatter chart in chartjs
- Css style not working well when resizing chart height in angular application
- Line chart doesn't work with type time chart.js
- react-chartjs-2 line chart with time on X-axes with multiple data sets plotted wrong
- code works fine on jsfiddle but one function is not working on website
More Query from same tag
- Displaying the first value of the array in datasets.label Chartjs
- Chart.js core.js:6162 ERROR Error: "line" is not a registered controller
- OffsetWidth / offsetHeight is zero when template loaded by ngRoute
- Chart.js: Change lengend colors to array
- Chart.js show data in chronological order
- How to convert a bar chart into a triangle shaped chart using Chart JS?
- How to change color by clicking on the chart bar?
- Displaying multiple line graphs on one page
- How do I use this new extension for chart.js?
- Chart.js drawing line between two points
- Linear x axis for bar chart chartjs
- ChartJS Email HTTP Request API
- How to fix chart looking blurry in ChartJS?
- What kind of graph could I use to achieve this with ChartJS (or similar)?
- Is there a way in chartjs to display different Boolean values with an offset in Y over a common timeline?
- npm chart.js is big after minimization
- How to make chart with chartjs.?
- Horizontal stacked bar chart with chart.js
- how get data from given string in javascript?
- Chartjs pie chart not showing from dynamic data
- ChartJS "Unable to get property 'getTime' of undefined or null reference"
- Chart.js 2.0 doughnut tooltip percentages
- Chart.js with 2 y-axis
- Angular 4: Different color for bar in bar chart dynamically using ChartJS
- Angular 2 & ng2-charts: (SystemJS) Unexpected directive 'BaseChartComponent' imported
- How to add space between two scales in chart-js?
- Chart.js displaying time data
- Parsing json in jQuery error
- Showing points data withou hover chartjs
- Pagination in Bar chart using ChartJS