<dy-chart-tooltip>

A tooltip component specifically designed for chart elements, providing contextual information about data points. It can be customized to display formatted values, labels, and additional information when hovering over chart elements.

Example

See <dy-area-chart>

import { ChartTooltip } from '@duoyun-fe/duoyun-ui/elements/chart-tooltip';

function onPointerMove({ x, y }) {
  ChartTooltip.open(x, y, {
    values: [
      {
        label: 'label',
        value: '123',
      },
    ],
  });
}

function onPointerOut() {
  ChartTooltip.close();
}

API

Shadow DOM; Extends GemElement

Static Properties

Property Type
instance DuoyunChartTooltipElement | null
open (x: number, y: number, data: Data) => void
close () => void