Chartjs-Chartjs – how to make line position to vertical center and how to display dotted sharp in the backround?

1👍

Chart.js version 2+

Use the borderDash property in scales.x|yAxes.gridLines configuration object.

Example :


var options = {
    scales: {
                xAxes: [{
                   gridLines: {
                      display: true,
                      lineWidth: 1,
                      borderDash: [1, 2],
                      color: "black"
                    }
                }],
                yAxes: [{
                   gridLines: {
                      display: true,
                      lineWidth: 1,
                      borderDash: [1, 2],
                      color: "black"
                    }
                }],
            }
}

Leave a comment