Accepted answer

Instead of editing all the chart and the Rectangle as in the duplicate, you should do it only for each bar you want to display with dashed lines.

If you take a look at the console (console.log(myChart) provides you a lot of info if you dare go deep in the object), you will see that every bar is instancied in[0]._meta[0].data[x], x being the xth bar of the dataset.

Knowing where you should go, you can now edit the .draw() method.

Here is a simple function you can use to make it work :

function dashedBorder(chart, dataset, data, dash) {

    // edit the .draw() function[dataset]._meta[0].data[data].draw = function() {
        Chart.elements.Rectangle.prototype.draw.apply(this, arguments);

        // put the line style back to the default value

You can see the result in this jsFiddle.

Related Query

More Query from same tag