import type { Axis } from "./axes/Axis"; import type { XYCursor } from "./XYCursor"; import type { AxisRenderer } from "./axes/AxisRenderer"; import type { IDisposer } from "../../core/util/Disposer"; import type { XYSeries } from "./series/XYSeries"; import type { IPointerEvent } from "../../core/render/backend/Renderer"; import type { Scrollbar } from "../../core/render/Scrollbar"; import type { IPoint } from "../../core/util/IPoint"; import type { ISpritePointerEvent } from "../../core/render/Sprite"; import type { Animation } from "../../core/util/Entity"; import { Container } from "../../core/render/Container"; import { SerialChart, ISerialChartPrivate, ISerialChartSettings, ISerialChartEvents } from "../../core/render/SerialChart"; import { ListAutoDispose } from "../../core/util/List"; import { Button } from "../../core/render/Button"; export interface IXYChartSettings extends ISerialChartSettings { /** * Horizontal scrollbar that zooms and pans the X axes. It goes above the * plot area, or below it with the scrollbar's `opposite` set. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/scrollbars/} for more info */ scrollbarX?: Scrollbar; /** * Vertical scrollbar that zooms and pans the Y axes. It goes right of the * plot area, or left of it with the scrollbar's `opposite` set. */ scrollbarY?: Scrollbar; /** * Stroke widths in pixels for line series to cycle through, by each * series' index in `series`. Helps tell lines apart without color. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Series_colors} for related info */ strokeWidths?: Array; /** * Dash patterns for line series to cycle through, by each series' index * in `series`. Each entry is a `strokeDasharray` value; `0` or an empty * array draws a solid line. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Series_colors} for related info */ strokeDasharrays?: Array>; /** * Lets the user pan the chart horizontally by dragging the plot area. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Panning} for more info * @default false */ panX?: boolean; /** * Lets the user pan the chart vertically by dragging the plot area. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Panning} for more info * @default false */ panY?: boolean; /** * What scrolling the wheel horizontally over the plot area does: zoom or * pan along X, Y or both. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Mouse_wheel_behavior} for more info */ wheelX?: "zoomX" | "zoomY" | "zoomXY" | "panX" | "panY" | "panXY" | "none"; /** * What scrolling the wheel vertically over the plot area does: zoom or pan * along X, Y or both. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Mouse_wheel_behavior} for more info */ wheelY?: "zoomX" | "zoomY" | "zoomXY" | "panX" | "panY" | "panXY" | "none"; /** * How far one wheel step zooms or pans, as a share of the visible range. * * @default 0.25 */ wheelStep?: number; /** * The chart's cursor. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/} for more info */ cursor?: XYCursor; /** * Limits the cursor's series tooltips to the one closest to the pointer, * plus any within this many pixels of it. `-1` shows only the closest one, * even when others are at the same spot. If not set, every series shows * its tooltip. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/#tooltips} for more info */ maxTooltipDistance?: number; /** * How `maxTooltipDistance` measures distance: `"xy"` by straight * distance, `"x"` or `"y"` along one direction only. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/#tooltips} for more info * @since 5.2.6 */ maxTooltipDistanceBy?: "xy" | "x" | "y"; /** * Moves the series tooltips shown by the cursor apart vertically so they * don't overlap. Works only with a `cursor`. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/#tooltips} for more info * @default true */ arrangeTooltips?: boolean; /** * Zooms the chart horizontally with a pinch gesture on the plot area. Not * supported in a [[RadarChart]]. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Pinch_zoom} for more info * @since 5.1.8 * @default false */ pinchZoomX?: boolean; /** * Zooms the chart vertically with a pinch gesture on the plot area. Not * supported in a [[RadarChart]]. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Pinch_zoom} for more info * @since 5.1.8 * @default false */ pinchZoomY?: boolean; /** * Position (0-1) to zoom the X axes around with the wheel, instead of the * pointer's position: `0` keeps the start of the visible range in place, * `1` the end. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Mouse_wheel_behavior} for more info * @since 5.2.11 */ wheelZoomPositionX?: number; /** * Position (0-1) to zoom the Y axes around with the wheel, instead of the * pointer's position: `0` keeps the start of the visible range in place, * `1` the end. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Mouse_wheel_behavior} for more info * @since 5.2.11 */ wheelZoomPositionY?: number; } export interface IXYChartPrivate extends ISerialChartPrivate { /** * Series whose tooltips the cursor currently shows. */ tooltipSeries?: Array; /** * Other charts whose plot areas count as this chart's when checking if * the pointer is over the plot, such as the other panels of a stock chart. */ otherCharts?: Array; } export interface IXYChartEvents extends ISerialChartEvents { /** * The pointer was pressed on the plot area, starting a pan (`panX` or * `panY` is set). * * @since 5.0.4 */ panstarted: { originalEvent: IPointerEvent; }; /** * The pointer was released, ending a pan. * * @since 5.0.4 */ panended: { originalEvent: IPointerEvent; }; /** * The pointer was pressed on the plot area and released without moving, * so nothing was panned. `panended` follows it. * * @since 5.2.19 */ pancancelled: { originalEvent: IPointerEvent; }; /** * A zoom or pan by the wheel finished. * * @since 5.0.4 */ wheelended: {}; } /** * A chart with X and Y axes, for line, column, scatter and other XY series. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/} for more info * @important */ export declare class XYChart extends SerialChart { static className: string; static classNames: Array; _settings: IXYChartSettings; _privateSettings: IXYChartPrivate; _seriesType: XYSeries; _events: IXYChartEvents; /** * The chart's X (horizontal) axes. */ readonly xAxes: ListAutoDispose>; /** * The chart's Y (vertical) axes. */ readonly yAxes: ListAutoDispose>; /** * Container above the plot area that holds the X axes with `opposite` * renderers. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly topAxesContainer: Container; /** * Container in the middle of the chart that holds the Y axes and the plot * area. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly yAxesAndPlotContainer: Container; /** * Container below the plot area that holds the X axes. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly bottomAxesContainer: Container; /** * Container left of the plot area that holds the Y axes. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly leftAxesContainer: Container; /** * Container that holds `plotContainer` and, over it, `topPlotContainer`. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly plotsContainer: Container; /** * The plot area, which holds the series, grid and bullets. * * It comes with a `background` already set: to change the plot area's fill * or outline, configure `plotContainer.get("background")`. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly plotContainer: Container; /** * Container over `plotContainer` for elements drawn on top of the plot * area, such as the zoom-out button. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly topPlotContainer: Container; /** * Container in the plot area that holds the axes' grid, below the series. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly gridContainer: Container; /** * Container in the plot area that holds the axis grid drawn above the * series, such as axis ranges with `above` set. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly topGridContainer: Container; /** * Container right of the plot area that holds the Y axes with `opposite` * renderers. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info * @default Container.new() */ readonly rightAxesContainer: Container; /** * Container that holds the axis headers. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-headers/} for more info * @default Container.new() */ readonly axisHeadersContainer: Container; /** * Button that zooms the chart out, shown while any axis is zoomed in. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Zoom_out_button} for more info * @default Button.new() */ readonly zoomOutButton: Button; _movePoint: IPoint; protected _wheelDp: IDisposer | undefined; _otherCharts?: Array; protected _movePoints: { [index: number]: IPoint; }; protected _downStartX?: number; protected _downEndX?: number; protected _downStartY?: number; protected _downEndY?: number; protected _afterNew(): void; _beforeChanged(): void; protected _setUpTouch(): void; protected _maskGrid(): void; protected _removeSeries(series: this["_seriesType"]): void; _applyThemes(force?: boolean): boolean; /** * Zooms or pans the chart for a wheel event, as set in `wheelX` and * `wheelY`. The chart calls it for the wheel over the plot area; call it * yourself to give other elements of the chart the same wheel behavior. * * @param event Wheel event, with `point` relative to the root */ handleWheel(event: { originalEvent: WheelEvent; point: IPoint; target: Container; }): void; protected _handleSetWheel(): void; protected _getWheelSign(axis: Axis): number; protected _fixWheel(start: number, end: number): [number, number]; protected _handlePlotDown(event: ISpritePointerEvent): void; protected _handleWheelAnimation(animation?: Animation): void; protected _dispatchWheelAnimation(): void; protected _handlePlotUp(event: ISpritePointerEvent): void; protected _handlePlotMove(event: ISpritePointerEvent): void; protected _handlePinch(): void; _handleCursorPosition(): void; _updateCursor(): void; protected _addCursor(cursor: XYCursor): void; _prepareChildren(): void; /** * Puts a scrollbar into one of two containers, depending on its `opposite` * setting, and moves it over if the setting changes later. `unshift` is for * the left container, which fills left to right, so the scrollbar has to go * in at the front to end up outside the axes. `outsideAxes`, when set, * decides the order instead. * * @ignore */ protected _placeScrollbar(key: "scrollbarX" | "scrollbarY", scrollbar: Scrollbar, container: Container, oppositeContainer: Container, unshift?: boolean): void; protected _processSeries(series: this["_seriesType"]): void; protected _colorize(series: this["_seriesType"]): void; protected _handleCursorSelectEnd(): void; protected _handleScrollbar(axes: ListAutoDispose>, start: number, end: number, priority?: "start" | "end"): void; protected _processAxis(axes: ListAutoDispose>, container: Container): IDisposer; protected _scrollbarInFront(container: Container, outside: boolean): boolean; /** * Keeps scrollbars with `outsideAxes` set on their side of the axes when * axes come or move. * * @ignore */ _keepScrollbarsInPlace(): void; protected _removeAxis(axis: Axis): void; _updateChartLayout(): void; /** * @ignore */ processAxis(axis: Axis): void; _handleAxisSelection(axis: Axis, force?: boolean): void; protected _handleZoomOut(): void; /** * Checks if a point is within the plot area. * * @param point Point relative to the plot area * @return `true` if the point is within the plot area */ inPlot(point: IPoint): boolean; /** * @ignore */ arrangeTooltips(): void; protected _tooltipToLocal(point: IPoint): IPoint; /** * Zooms the chart fully out, on every axis whose `zoomOut` is not * `false`. */ zoomOut(): void; protected _dispose(): void; } //# sourceMappingURL=XYChart.d.ts.map