Kishan silawat
Posts: 18
Joined: Thu Nov 24, 2022 10:10 am

x-Axis css property.

Hello,

I have added a class name in the x-axis and trying to change CSS when I'm changing (position: fixed) it is not making it fixed.

I'm also adding a scrollbar for this I need to fix the x-axis while scrolling.
Is there any other way to make the x-axis fixed in the Gantt chart?
User avatar
dawid.d
Posts: 755
Joined: Thu Oct 06, 2022 11:31 am

Re: x-Axis css property.

Hello,

Thanks for contacting us with your question!

If you are talking about scrolling for the x-axis, have you considered using the Highcharts built-in scrollbar?
See: https://api.highcharts.com/gantt/scrollbar

Demo: https://jsfiddle.net/BlackLabel/wxzomuys/

For y-axis scrolling, use scrollablePlotArea.
See: https://api.highcharts.com/gantt/chart. ... .minHeight

Let me know if that was what you were looking for!
Best regards
Dawid Draguła
Highcharts Developer
Kishan silawat
Posts: 18
Joined: Thu Nov 24, 2022 10:10 am

Re: x-Axis css property.

Thanks for the reply and solution.

I need to use like this https://jsfiddle.net/gh/get/library/pur ... a-vertical

But the problem is here it is not showing all the data because of the minHeight. Can we set minHeight dynamically of the basis of data length?
User avatar
dawid.d
Posts: 755
Joined: Thu Oct 06, 2022 11:31 am

Re: x-Axis css property.

Hi,

I thought about it more and it seems that in your case an even better way would be to set the scrollbar for the y-axis.

Demo: https://jsfiddle.net/BlackLabel/r6Lhf05n/

Unfortunately, you can run into a problem here as well when using collapsible rows at the same time. I found a bug report on our official GitHub about this topic. See: https://github.com/highcharts/highcharts/issues/13898 You can read more about it there, ask for an update and possible workarounds.

Feel free to ask any further questions!
Best regards!
Dawid Draguła
Highcharts Developer

Return to “Highcharts Gantt”