[Chartjs]-How to display axis borders only (no grid lines) in chartjs?

3👍

Solved it (sort of). When I downgrade to chart.js 2.8.0 the chart borders now display as expected. With 2.9.3 the borders were not showing at all, regardless of chart type.

5👍

You can put this options in gridline properties:

xAxes: [{
        gridLines: {
          display: true,
          drawBorder: true,
          drawOnChartArea: false
        }
     }]

Source: https://www.chartjs.org/samples/latest/scales/gridlines-display.html

3👍

gridLines: { drawBorder: true, lineWidth: 0 }

Leave a comment