javascriptreactjsapexchartsreact-apexcharts

How to completely remove Grid horizontal bar lines in apexcharts


Here I have marked bar lines in the line graph in red color.

graph current image with grid bar type lines

Any suggestions on how to remove them or make them transparent so that they match the background color? I tried setting the background "transparent" but that is not working.

Note: I'm using theme "dark" in options


Solution

  • There are a couple of different ways to remove or style the grid in the options depending on the desired outcome.

    Remove grid: You can hide the grid entirely, which also hides the y-axis labels.

    grid:{
      show: false
    }
    

    Hide lines: If you want to keep the labels, you can hide the grid lines specifically.

    grid: {
      yaxis: {
        lines: {
          show: false
        }
      }
    }