Reactjs 图表显示标签,但不显示刻度

Reactjs 图表显示标签,但不显示刻度,reactjs,charts,chart.js,Reactjs,Charts,Chart.js,我在React应用程序中使用ChartJS来呈现带有垂直条和 我需要在每个条的底部显示标签,但隐藏条之间的垂直线(记号)。以下是我迄今为止所做的尝试: 这与我想要的正好相反,它显示刻度,但不显示标签: xAxes : [ { display : true, // set this to false to hide the labels under the bars ticks: { display : false }

我在React应用程序中使用ChartJS来呈现带有垂直条和 我需要在每个条的底部显示标签,但隐藏条之间的垂直线(记号)。以下是我迄今为止所做的尝试:

这与我想要的正好相反,它显示刻度,但不显示标签:

xAxes : [ {
        display : true, // set this to false to hide the labels under the bars
        ticks: {
            display : false
        }
    }]
xAxes : [ {
            display : true, // set this to false to hide the labels under the bars
            maxTicksLimit: 0
        }]
这显示了所有内容:

xAxes : [ {
        display : true, // set this to false to hide the labels under the bars
        ticks: {
            display : false
        }
    }]
xAxes : [ {
            display : true, // set this to false to hide the labels under the bars
            maxTicksLimit: 0
        }]

有什么建议吗?

将网格线显示设置为false怎么样

xAxes: [{
    gridLines: {display:false}
    }]

对于Chartjs 2.9.3,您可以使用:

    xAxes: [{
      gridLines: {
        drawTicks: false,
       }
    }]