score:1

Accepted answer

you can set the ticks display to false like so:

  options: {
    scales: {
      y: {
        ticks: {
          display: false
        }
      },
      x: {
        ticks: {
          display: false
        }
      }
    }
  }

example:

var options = {
  type: 'line',
  data: {
    labels: ["red", "blue", "yellow", "green", "purple", "orange"],
    datasets: [{
        label: '# of votes',
        data: [12, 19, 3, 5, 2, 0],
        borderwidth: 1,
        backgroundcolor: ["red", "blue", "yellow", "green", "purple", "orange"]
      },
      {
        label: '# of counts',
        data: [1, 2, 3, 4, 5, 2],
        borderwidth: 1,
        backgroundcolor: ["red", "blue", "yellow", "green", "purple", "orange"]
      }
    ]
  },
  options: {
    scales: {
      y: {
        ticks: {
          display: false
        }
      },
      x: {
        ticks: {
          display: false
        }
      }
    }
  }
}

var ctx = document.getelementbyid('chartjscontainer').getcontext('2d');
const chart = new chart(ctx, options);
<body>
  <canvas id="chartjscontainer" width="600" height="400"></canvas>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/3.1.0/chart.js" integrity="sha512-llfvdzpyhqdasf4azfspmyhd6+wayvfjrwfjrbgki7/uh+txmlfyckmrim65+o3lfsfk20vrk9sjdute7buauw==" crossorigin="anonymous"></script>
</body>

score:0

if you have a label with ticks you can use

options: {
  scales: {
    y: {
      ticks: {
        display: false
      },
      scalelabel: {
        display: false,
        labelstring: 'yaxes scalelabel text'                                
      }
    },
    x: {
      ticks: {
        display: false
      },
      scalelabel: {
        display: false,
        labelstring: 'xaxes scalelabel text'                                
      }
    }
  }
}

Related Query

More Query from same tag