javascriptsvgchartist.js

Chartist: remove all grid lines but display axis


I know there is an option to remove gridlines: showGrid: false. But that will remove all grid lines including main axes.

Is there a way to remove all gridlines except main axis like this? enter image description here


Solution

  • It is possible to achieve that with pure css:

    .ct-vertical ~ .ct-vertical {
        stroke: none;
    }
    .ct-horizontal ~ .ct-horizontal {
        stroke: none;
    }