首页 > 解决方案 > 如何以角度删除图表的水平线及其轴线?

问题描述

以下是一个角度应用程序,其图表由顶点图表组成

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

如何删除该图表的水平线及其轴线(这样看起来更干净)

    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"
          }
        }
      }
    };

以及如何格式化工具提示颜色?

标签: apexcharts

解决方案


现在你可以使用这个选项

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
         }
       },   
    },
  }

有关更多详细信息,您可以使用此参考


推荐阅读