show label in tooltip but not in x axis for chartjs line chart

前端 未结 5 1646
死守一世寂寞
死守一世寂寞 2020-12-08 23:34

I currently am using a line chart with chart.js, and have a label set that looks like this [\"January 2015\", \"February 2015\", \"March 2015\", \"April 2015\", \"May

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 00:31

    At Chart Options, under xAxes you can specify the maxTickLimit property to whatever you like:

    xAxes: [{
            ticks: {
            autoSkip:true,
            maxTicksLimit:3
            }
         }]
    

    Fiddle : https://jsfiddle.net/p63z7zys/1/

提交回复
热议问题