How to Create a Scrollable Horizontal Bar Chart with Fixed X Scale in Chart JS

preview_player
Показать описание
How to Create a Scrollable Horizontal Bar Chart with Fixed X Scale in Chart JS

However, it becomes harder if you want to make sure the scale will not move on scroll. Our approach will be out of the ordinary and we need to use all the tricks to get this working. We will be splitting the chart into two parts. So it will visually appears as one.

Let's explore how to do this.

▬ Chartjs Source Code ▬▬▬▬▬▬▬▬▬▬

▬ Chartjs Viewers Question Series ▬▬▬▬▬▬▬▬▬▬

This is part of the Chartjs Viewers Question series. Where we answer viewer questions. This question was asked by one of our viewers.

▬ Materials/References ▬▬▬▬▬▬▬▬▬▬

To keep the video short we might expect you to know parts. These parts we have explained in other videos. You can find the references here below:

▬ Got a Question? Comment! ▬▬▬▬▬▬▬▬▬▬

Got a question or special request about a specific item? Comment below and tell me your question. I will make sure to follow up on you!

▬ Find Me Here ▬▬▬▬▬▬▬▬▬▬

Chart JS tutorials for Beginners:

Chart JS tutorials for Intermediate:

Chart JS Dashboard Series:
👍 Most Liked Video Series:

▬ About Us ▬▬▬▬▬▬▬▬▬▬▬▬

Why we created these #chartjs and #javascript video tutorials?

WHY
Creating charts in javascript is very rewarding but extremely challenging. The Chart JS library made it easier to render charts. However the chart js documentation is hard to understand for many. It requires a lot of different moving parts to work along. The canvas tag, javascript, arrays and Chart JS all need to be combined to draw an eye catching bar chart or line chart.

The videos explains the chart js documentation in a more visual and easy to understand way. You can follow along with the code and quickly grasp how it works. We cover the code in chart js but also what truly happens and why something happens when we write a line of code. This fundamental understanding gives clarity to you as a developer in chartjs. In short it is the Chart JS video documentation.

HOW
We answer questions from YOU (viewers) by creating an answer video that covers the questions YOU have posted in the comment section.

WHAT
Our goal is to help YOU learn how to draw charts in Chart JS by showing you in video format how to do it.

▬ Chart JS 3.9.1 ▬▬▬▬▬▬▬▬▬▬▬▬

Chart JS is a javascript library to draw charts in the canvas tag on your site. Presenting data in a visual manner such as charts is more effective and appealing. All the charts are always coded in the latest Chartjs version which is as of this recording Chart JS 3.9.1.

What type of charts can you make with Chart.JS?
With chart js you can make line chart, bar chart, pie chart, doughnut chart, scatter chart, polar area chart, radar chart, gauge chart and area chart. And with some clever tricks and visual adjustment more can be done.
Рекомендации по теме
Комментарии
Автор

Thank you! Thank you! You are a life saver indeed!

aknownunknown
Автор

Thank you for making this video. This is a life saver.

sivarmu
Автор

Hi I have been following you tutorial on scroll it was really nice.

However I was waiting for a video where you said I could just drag and drop the scroll via mouse, have you completed that video or made any similar one ?

topratiksharma
Автор

This solution is excellent, I could implement in my static data of an HTML page, and Also in a dynamic data driven React JS webpage. It works great in the React page as well.

But here I do have one particular issue. The issue is: when the chart loads for the first time and the data is huge in number (almost loads 1000 horizontal bars), the first load doesn't make the second canvas x-axis aligned with the above canvas.
But if I am selecting another filter, and the page loads, then it appears fine automatically. Any solution around this please.
Thank You so much Chat JS team.

sivarmu
Автор

Hi, thanks for this great video. How can we make a horizontal scrollbar and scroll horizontally

hamadsherazi
Автор

Good work but my tooltip is only partially avilable for the top bars when scrolled

j.pjagadesan