Chartjs-How to show tick marks and labels with grid line for the specific one on the X axis with Chart.js?

1👍

use this for your labels array:

labels: [["jan", 20], "", "", "", "", "", ["jul", 20], "", "", "", "", "", ["jan", 21]],

and this to your options object:

options: {
    scales: {
        xAxes: [{
            ticks: {
               callback: (label) => (label === "" ? null : label)
          }
      }]
    }
  }

will get the following result:
enter image description here

Since the tick marks are getting generated from the grid lines they dissapear too, dont know how you can fix that

Leave a comment