Remove the vertical line in the chart js line chart

后端 未结 5 1722
孤街浪徒
孤街浪徒 2021-02-05 01:21

I am using Chart.js to generate maps and have customised it to a good extent. But I am not able to remove the vertical grid line no matter what. Has anyone come acr

相关标签:
5条回答
  • 2021-02-05 02:02

    I think you can seperate x and y axis.

      axes: {
            xaxis: {
                ticks: ticks,
                tickOptions: {showGridline:false}
            },
            yaxis: {
                tickOptions: {showGridline:true}
            }
        }
    

    Hope this can help you.

    0 讨论(0)
  • 2021-02-05 02:11
    options : {
                scales: {
                    yAxes: [{
                        gridLines: {
                            lineWidth: 0,
                            color: "rgba(255,255,255,0)"
                        }
                    }]
                }
        };
    Charts.js v2.0
    
    0 讨论(0)
  • 2021-02-05 02:13

    try "scaleShowGridLines" : false,

    0 讨论(0)
  • 2021-02-05 02:21

    The following applies to Chart.js 2.*.

    If you only have one x-axis, whether the vertical grid lines (that are related to this x-axis) are displayed or not, is specified by the boolean value of options.scales.xAxes[0].gridLines.display. To be more precise, the following chart options disable the display of vertical grid lines for the single x-axis case.

    options : {
        scales : {
            xAxes : [ {
                gridLines : {
                    display : false
                }
            } ]
        }
    }
    
    0 讨论(0)
  • 2021-02-05 02:22

    There's a new global option that was released with the new version of Chart.js two days ago.

    var options = {
        scaleShowVerticalLines: false
    }
    
    0 讨论(0)
提交回复
热议问题