import type { IBounds } from "../util/IBounds"; import type { IPoint } from "../util/IPoint"; import type { Pattern } from "../render/patterns/Pattern"; import type { Time } from "../util/Animation"; import type { Sprite } from "../render/Sprite"; import type { DataItem, IComponentDataItem } from "./Component"; import type { Root } from "../Root"; import type { Template } from "../util/Template"; import type { Entity } from "../util/Entity"; import { MultiDisposer, IDisposer } from "../util/Disposer"; import { Label } from "../render/Label"; import { Container, IContainerPrivate, IContainerSettings } from "./Container"; import { Color } from "../util/Color"; export interface ITooltipSettings extends IContainerSettings { /** * Text of the tooltip's label. It can hold data placeholders, such as * `{valueY}`. */ labelText?: string; /** * HTML content of the tooltip's label, shown in place of `labelText`. * * @since 5.2.11 */ labelHTML?: string; /** * A screen reader content for the label. * * Used in conjuction with `readerAnnounce`. If it is set to `true`, and * `labelAriaLabel` is set, its contents will be read out by a screen reader * when tooltip is shown or its data item changes. * * Otherwise, regular `labelText` (or `text` set directly on tooltip label) will * be used for screen reader announcement. * * @since 5.9.2 */ labelAriaLabel?: string; /** * Which way the tooltip's pointer points: `"down"` puts the tooltip above * the point, `"up"` below it, `"left"` to its right and `"right"` to its * left. `"vertical"` and `"horizontal"` pick the side that has room. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/tooltips/#Orientation} for more info * @default "vertical" */ pointerOrientation?: "left" | "right" | "up" | "down" | "vertical" | "horizontal"; /** * Gives the background the `fill` of the `tooltipTarget` (its `stroke`, if * it has no fill). * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/tooltips/#Colors} for more info * @default true */ getFillFromSprite?: boolean; /** * Gives the background the `fillGradient` of the `tooltipTarget`. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/tooltips/#Colors} for more info * @default false */ getFillGradientFromSprite?: boolean; /** * Gives the label text the `fill` of the `tooltipTarget` (its `stroke`, if * it has no fill). Needs `autoTextColor: false`, which otherwise overrides * it. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/tooltips/#Colors} for more info * @default false */ getLabelFillFromSprite?: boolean; /** * Gives the background's stroke the `fill` of the `tooltipTarget` (its * `stroke`, if it has no fill). * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/tooltips/#Colors} for more info * @default false */ getStrokeFromSprite?: boolean; /** * Area to keep the tooltip within, in pixels relative to the root. If not * set, the whole chart area. */ bounds?: IBounds; /** * Picks a light or dark text color, whichever reads better on the * background. * * @default true */ autoTextColor?: boolean; /** * The point the tooltip points to, relative to the root. */ pointTo?: IPoint; /** * Duration in milliseconds of the tooltip's move to a new position, e.g. * from one target to another. */ animationDuration?: number; /** * Easing function of the tooltip's moves. * * @see {@link https://www.amcharts.com/docs/v5/concepts/animations/#Easing_functions} for more info */ animationEasing?: (t: Time) => Time; /** * The element the tooltip is shown for. */ tooltipTarget?: Sprite; /** * Keeps the target element hovered while the pointer is over the tooltip * itself. * * @since 5.2.14 */ keepTargetHover?: boolean; /** * If set to `true` the tooltip contents will be read out by a screen reader * when displayed or changed. * * @default false * @since 5.9.2 */ readerAnnounce?: boolean; } export interface ITooltipPrivate extends IContainerPrivate { } /** * A label in a pointed box that points at an element or a point. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/tooltips/} for more info * @important */ export declare class Tooltip extends Container { _fx: number; _fy: number; _settings: ITooltipSettings; _privateSettings: ITooltipPrivate; protected _label: Label; static className: string; static classNames: Array; protected _fillDp: IDisposer | undefined; protected _fillGrDp: IDisposer | undefined; protected _strokeDp: IDisposer | undefined; protected _labelDp: IDisposer | undefined; protected _w: number; protected _h: number; protected _keepHoverDp: MultiDisposer | undefined; protected _htmlContentHovered: boolean; constructor(root: Root, settings: Entity["_settings"], isReal: boolean, templates?: Array>); protected _afterNew(): void; /** * Shown for a keyboard-focused element (`hoverOnFocus`): announced to * screen readers even without `readerAnnounce`. * * @ignore */ _focusAnnounce: boolean; protected _handleReaderAnnouncement(): void; protected _repeatsTargetLabel(text: string): boolean; /** * The tooltip's [[Label]]. * * @readonly * @return Label */ get label(): Label; /** * Permanently disposes the tooltip. */ protected _dispose(): void; _updateChildren(): void; _changed(): void; protected _onShow(): void; /** * Takes the colors from `tooltipTarget` again, as the `get...FromSprite` * settings say. */ updateBackgroundColor(): void; protected _updateTextColor(fill?: Color | Pattern): void; _setDataItem(dataItem?: DataItem): void; protected _updateBackground(): void; } //# sourceMappingURL=Tooltip.d.ts.map