Is there any way to provide left margin on y axis label to avoid the chart moving Chartjs?

114 Views Asked by At

I am using Chart JS for bar representation. and using this link https://stackblitz.com/edit/ng2-chart-scrollable?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts for scrolling the bar chart.

In vertical bar, everything working fine. But in horizontal bar while scrolling the y axis moving. It is because of the characters length the chart is moving on scroll.

In this image u can see the position of the chart

In the above picture, you can see the chart position.

second picture

this is second picture the chart position slightly moves to left.

i Know this is because of the character, I have tried some logic like adding empty spaces based on maximum character shown to other words which is less than the bigger words.

Is there any way to make it fixed without moving. or can we try adding margin left before y axis label, if yes how to add a margin to it. Because in highchart I have seen something like margin left fixes this thing, But I don't know how to implement in chartjs

0

There are 0 best solutions below