[Chartjs]-Chart.js: hide specific ticks in y-axis and hide all x-axis grid line

12👍

Use the afterBuildTicks option for the scales/yAxes

yAxes: [{

  ticks: {
    min: 0,
    max: 100

  },
  afterBuildTicks: function(humdaysChart) {    
    humdaysChart.ticks = [];
    humdaysChart.ticks.push(0);
    humdaysChart.ticks.push(50);
    humdaysChart.ticks.push(100);    
  }
}]

or you can also use ‘stepSize’

   yAxes: [{

        ticks: {
            min:0,
            max:100,
            stepSize:50

        }
    }]

http://jsfiddle.net/Lehuga5o/

Leave a comment