How to create a time scales chart in Chart JS. In this post we will cover how to create a time scales chart. Creating a time scales chart in Chart JS is quite tricky. The official Chart JS documentation has a short written topic but many tend to struggle. Watch this video:
Time Scales Chart in Chart JS
The time scales chart in Chart JS is not officially a different chart. It can be a bar chart or a line chart. The difference is that the x-axis contains a time frame which is directly connected with one of the date-adaptors. This is very important as you will need of the date-adaptors.
Date Adaptors and Chart JS
Sadly, Moments.js which was a very well known time JS library has been deprecated. This means that there are not more updates and it is not being maintained any more. So using other options is a must as this will be not support in any other new Chart JS updates. Make sure you use Luxon or Data-fns just as the video shown.
Leave a Reply
You must be logged in to post a comment.