有没有办法删除Apexcharts线图底部的气泡盒?

发布于 2025-01-22 23:53:59 字数 2880 浏览 0 评论 0原文

尚未找到一种方法,只要悬停在线图的底部,就可以删除或隐藏气泡盒。已经检查了该文档,但我仍然没有找到它,或者我只是缺少一些东西。抱歉,这个问题仍然是初学者,当涉及到Angular和ApexCharts时。

这是样本: https ://codesandbox.io/s/apx-line-basic-forked-iltgss?file =/src/app/app/app.component.html

我想删除的图片: https://i.sstatic.net/8wuob.jpg

//i.sstatic.net/8wuob.jpg

import { Component, ViewChild } from "@angular/core";

import {
  ChartComponent,
  ApexAxisChartSeries,
  ApexChart,
  ApexXAxis,
  ApexYAxis,
  ApexStroke,
  ApexGrid,
  ApexFill,
  ApexTooltip
} from "ng-apexcharts";

export type ChartOptions = {
  series: ApexAxisChartSeries;
  chart: ApexChart;
  xaxis: ApexXAxis;
  yaxis: ApexYAxis;
  grid: ApexGrid;
  stroke: ApexStroke;
  fill: ApexFill;
  tooltip: ApexTooltip;
};

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"]
})
export class AppComponent {
  @ViewChild("chart") chart: ChartComponent;
  public chartOptions: Partial<ChartOptions>;

  constructor() {
    this.chartOptions = {
      series: [
        {
          name: "",
          data: [2, 10, 18, 22, 36, 15, 47, 75, 65, 19, 14, 2, 47, 42, 15]
        }
      ],
      chart: {
        height: 350,
        type: "line",
          toolbar: {
          show: false
        },
          zoom: {
          enabled: false
        }
      },
      stroke: {
        curve: "smooth"
      },
      grid: {
        show: false
      },
      xaxis: {
        labels: {
          show: false
        },
        axisBorder: {
          show: false
        }
      },
      yaxis: {
        show: false
      },
      fill: {
        type: "gradient",
        gradient: {
          shade: "dark",
          gradientToColors: ["#5156be"],
          shadeIntensity: 1,
          type: "horizontal",
          opacityFrom: 1,
          opacityTo: 1,
          stops: [100]
        }
      },
      tooltip: {
        enabled: true,
        followCursor: false,
        marker: {
          show: false
        },
        x: {
          show: false
        },
        y: {
          formatter: undefined,
          title: {
            formatter: (seriesName) => seriesName
          }
        }
      }
    };
  }
}

> html

<div id="chart">
  <apx-chart
    [series]="chartOptions.series"
    [chart]="chartOptions.chart"
    [xaxis]="chartOptions.xaxis"
    [yaxis]="chartOptions.yaxis"
    [grid]="chartOptions.grid"
    [stroke]="chartOptions.stroke"
    [fill]="chartOptions.fill"
    [tooltip]="chartOptions.tooltip"
  ></apx-chart>
</div>

Haven't found a way to remove or hide the bubble box at the bottom of the line chart whenever it is hovered. Already checked the documentation and I still didn't found it, or I was just missing something. Sorry for the question, still a beginner when it comes to Angular and using apexcharts.

Heres the sample: https://codesandbox.io/s/apx-line-basic-forked-iltgss?file=/src/app/app.component.html

Picture of what I want to remove: https://i.sstatic.net/8WUoB.jpg

app.component.ts

import { Component, ViewChild } from "@angular/core";

import {
  ChartComponent,
  ApexAxisChartSeries,
  ApexChart,
  ApexXAxis,
  ApexYAxis,
  ApexStroke,
  ApexGrid,
  ApexFill,
  ApexTooltip
} from "ng-apexcharts";

export type ChartOptions = {
  series: ApexAxisChartSeries;
  chart: ApexChart;
  xaxis: ApexXAxis;
  yaxis: ApexYAxis;
  grid: ApexGrid;
  stroke: ApexStroke;
  fill: ApexFill;
  tooltip: ApexTooltip;
};

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"]
})
export class AppComponent {
  @ViewChild("chart") chart: ChartComponent;
  public chartOptions: Partial<ChartOptions>;

  constructor() {
    this.chartOptions = {
      series: [
        {
          name: "",
          data: [2, 10, 18, 22, 36, 15, 47, 75, 65, 19, 14, 2, 47, 42, 15]
        }
      ],
      chart: {
        height: 350,
        type: "line",
          toolbar: {
          show: false
        },
          zoom: {
          enabled: false
        }
      },
      stroke: {
        curve: "smooth"
      },
      grid: {
        show: false
      },
      xaxis: {
        labels: {
          show: false
        },
        axisBorder: {
          show: false
        }
      },
      yaxis: {
        show: false
      },
      fill: {
        type: "gradient",
        gradient: {
          shade: "dark",
          gradientToColors: ["#5156be"],
          shadeIntensity: 1,
          type: "horizontal",
          opacityFrom: 1,
          opacityTo: 1,
          stops: [100]
        }
      },
      tooltip: {
        enabled: true,
        followCursor: false,
        marker: {
          show: false
        },
        x: {
          show: false
        },
        y: {
          formatter: undefined,
          title: {
            formatter: (seriesName) => seriesName
          }
        }
      }
    };
  }
}

HTML

<div id="chart">
  <apx-chart
    [series]="chartOptions.series"
    [chart]="chartOptions.chart"
    [xaxis]="chartOptions.xaxis"
    [yaxis]="chartOptions.yaxis"
    [grid]="chartOptions.grid"
    [stroke]="chartOptions.stroke"
    [fill]="chartOptions.fill"
    [tooltip]="chartOptions.tooltip"
  ></apx-chart>
</div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最笨的告白 2025-01-29 23:53:59

Disable tooltip in xaxis https://apexcharts.com/docs/options/xaxis/#tooltip

  tooltip: {
      enabled: false,
  },
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文