简体   繁体   中英

How to remove all gridlines and ticks all lines in lines chart in javascript taken from cdn)

Guys I have js chart line and I want to remove all gridlines and ticks both from xAxes and yAxes .

I tried:

 options: {legend: {display: false},scales : {  xAxes : [ {gridLines : {display : false}}, ] ,
 yAxes:[ {gridLines: {display :false}}]},

}

But it only removes gridlines . I tried to add to xAxes ticks{display: false} but it does not work. Any idea how to remove all gridlines and ticks ?

Use

options: {
  scales: {
    yAxes: [{
      gridLines: {
        display: false,
        drawBorder: false
      },
      ticks: {
        display: false
      }
    }],
    xAxes: [{
      gridLines: {
        display: false
      },
      ticks: {
        display: false
      }
    }]
  }
}

Demo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM