Jai Kumaresh
Jai Kumaresh

Reputation: 835

Chartjs xaxis labels auto decrease disabled

I used chartjs bar chart. It's for one year 52 week's based data show. So xaxis labels are 52.

And I will use option.responsive = true for my chart fixed width & height.

But the chartjs is auto hide some xaxis label. I need to disable auto hide some xaxis label option.

Upvotes: 1

Views: 820

Answers (1)

Jai Kumaresh
Jai Kumaresh

Reputation: 835

Use autoSkip option it's a possible way. For ex:

options.scales.xAxes[0].ticks.autoSkip = false

(or)

options: {
   scales: {
      xAxes: [{
         ticks: {
            autoSkip: false,
            maxRotation: 90,
            minRotation: 90
         }
      }]
   }
}

Ref to : https://www.chartjs.org/docs/latest/axes/cartesian/?h=autoskip

Upvotes: 2

Related Questions