7

Following is an angular app with graphs made of apex charts

https://codesandbox.io/s/apx-column-distributed-d3ns7?from-embed

How can I remove the horizontal lines of that chart & its axis lines (so that this looks much cleaner)

    this.chartOptions = {
      series: [
        {
          name: "distibuted",
          data: [21, 22,]
        }
      ],
      chart: {
        height: 350,
        type: "bar",
        events: {
          click: function(chart, w, e) {
            // console.log(chart, w, e)
          }
        }
      },
      colors: [
        "#008FFB",
        "#00E396",
      ],
      plotOptions: {
        bar: {
          columnWidth: "45%",
          distributed: true
        }
      },
      dataLabels: {
        enabled: false
      },
      legend: {
        show: false
      },
      xaxis: {
        categories: [
          ["John", "Doe"],
          ["Joe", "Smith"],
        ],
        labels: {
          style: {
            colors: [
              "#008FFB",
              "#00E396",
            ],
            fontSize: "12px"
          }
        }
      }
    };

& also how can I format the tooltip colors ?

reacg garav
  • 477
  • 1
  • 4
  • 11

3 Answers3

15

By now you can use this option

chartOptions: {
    chart: {
      id: "basic-bar",
    },
    grid: {
      show: true,      // you can either change hear to disable all grids
      xaxis: {
        lines: {
          show: true  //or just here to disable only x axis grids
         }
       },  
      yaxis: {
        lines: { 
          show: true  //or just here to disable only y axis
         }
       },   
    },
  }

for more details you can use this reference

4

The grid-lines can be hidden using the following ways.

grid: {
    show: false
}

or

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

Edit: In your example, you were missing

  <apx-chart
    [grid]="chartOptions.grid"
  ></apx-chart>
junedchhipa
  • 4,694
  • 1
  • 28
  • 28
3

in your configuration add axisBorder and axisTicks configurations, I couldn't find how to remove the horizontal bars completely though. If I find it I will be back.

xaxis
  categories: [
    ["John", "Doe"],
    ["Joe", "Smith"],
  ],
  axisBorder: {
    show: false
  },
  axisTicks: {
    show: false,
  },
akmur
  • 1,465
  • 2
  • 24
  • 37