import type { Root } from "../../core/Root"; import type { Chart } from "./Chart"; import type { Bullet } from "./Bullet"; import type { ILegendDataItem } from "./Legend"; import type { Template } from "../../core/util/Template"; import type { Sprite } from "../../core/render/Sprite"; import type { Pattern } from "./patterns/Pattern"; import type { Gradient } from "./gradients/Gradient"; import { Component, IComponentSettings, IComponentPrivate, DataItem, IComponentEvents, IComponentDataItem } from "../../core/render/Component"; import { List } from "../../core/util/List"; import { Color } from "../../core/util/Color"; import { Container } from "../../core/render/Container"; /** * A rule that sets a setting of each series element, such as its color or * size, by its data item's value: from `min` at the lowest value to `max` at * the highest. * * @see {@link https://www.amcharts.com/docs/v5/concepts/settings/heat-rules/} for more info */ export interface IHeatRule { /** * Template of the elements to set, e.g. `series.columns.template`. */ target: Template; /** * Setting value for the element with the lowest value. */ min?: any; /** * Setting value for the element with the highest value. */ max?: any; /** * Setting value for elements whose data item has no value. */ neutral?: any; /** * Setting values for a scale through more than two, in place of `min` and * `max`: the element with the lowest value gets the first, the one with * the highest the last, and the ones between blend through the stops * between. Numbers, percents or colors, all of one kind, e.g. * `[negative, warning, positive]` from the interface colors. Values * outside `minValue` and `maxValue` get the first or last stop. * * @since 5.21.2 */ stops?: Array; /** * Data item field that holds the value, e.g. `"value"` or `"valueY"`. */ dataField: string; /** * The setting to set, e.g. `"fill"`. */ key?: string; /** * Lowest value of the range. If not set, the series' lowest value is used, * which needs `calculateAggregates`. */ minValue?: number; /** * Highest value of the range. If not set, the series' highest value is * used, which needs `calculateAggregates`. */ maxValue?: number; /** * Spreads the values between `min` and `max` on a logarithmic scale. * * @default false */ logarithmic?: boolean; /** * A function that sets the element's settings itself, in place of `min`, * `max` and `key`. It is called for each element, also for one with no * value. */ customFunction?: (target: Sprite, minValue: number, maxValue: number, value?: any) => void; } export interface ISeriesDataItem extends IComponentDataItem { id?: string; /** * A URL to open when the data item's element is clicked. * * @since 5.20.7 */ url?: string; value?: number; valueWorking?: number; valueChange?: number; valueChangePercent?: number; valueChangeSelection?: number; valueChangeSelectionPercent?: number; valueChangePrevious?: number; valueChangePreviousPercent?: number; valueWorkingOpen?: number; valueWorkingClose?: number; customValue?: number; customValueWorking?: number; customValueChange?: number; customValueChangePercent?: number; customValueChangeSelection?: number; customValueChangeSelectionPercent?: number; customValueChangePrevious?: number; customValueChangePreviousPercent?: number; } export interface ISeriesSettings extends IComponentSettings { /** * Name of the series. */ name?: string; /** * A key to look up in data for an id of the data item. */ idField?: string; /** * A key to look up in data for a URL to open when the data item's element * (a bullet, column, slice, map polygon or map line) is clicked. Links are * off until this is set. * * @since 5.20.7 */ urlField?: string; /** * Where a data item's URL opens: `"_self"` for the same window, `"_blank"` * for a new tab, or a named window / frame. A chart embedded in an iframe * usually wants `"_blank"` or `"_top"`. * * @default "_self" * @since 5.20.7 */ linkTarget?: string; /** * A key to look up in data for a numeric value of the data item. Some * series draw their elements by it; heat rules can use it too. */ valueField?: string; /** * A key to look up in data for an extra numeric value of the data item * (`customValue`), e.g. for heat rules. */ customValueField?: string; /** * Text template for the item's label in a [[Legend]]. */ legendLabelText?: string; /** * Text template for the item's value label in a [[Legend]]. */ legendValueText?: string; /** * Shows and hides the data items one after another instead of all at * once, including in the initial animation. Works in XY and percent * series. * * @see {@link https://www.amcharts.com/docs/v5/concepts/animations/#Animation_of_series} for more info */ sequencedInterpolation?: boolean; /** * Extra delay in milliseconds between the animations of consecutive data * items, with `sequencedInterpolation`. * * @see {@link https://www.amcharts.com/docs/v5/concepts/animations/#Animation_of_series} for more info */ sequencedDelay?: number; /** * Heat rules to apply to the series' elements. A rule without `minValue` * and `maxValue` needs `calculateAggregates` to find the value range. * * @see {@link https://www.amcharts.com/docs/v5/concepts/settings/heat-rules/} for more info */ heatRules?: IHeatRule[]; /** * Makes the series compute aggregate values, such as sums, averages, lows, * highs and changes. * * Enable it only if they are used, e.g. in tooltips, data fields or heat * rules. */ calculateAggregates?: boolean; /** * Series stroke color. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Series_colors} for more info */ stroke?: Color; /** * Series fill color. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Series_colors} for more info */ fill?: Color; /** * Series fill pattern. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/} for more info * @since 5.10.0 */ fillPattern?: Pattern; /** * Series fill gradient. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/gradients/} for more info */ fillGradient?: Gradient; /** * Series stroke gradient. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/gradients/} for more info */ strokeGradient?: Gradient; /** * The series' data item in a [[Legend]]. * * @readonly */ legendDataItem?: DataItem; /** * Fields to leave out of `calculateAggregates`, to save work where their * aggregates are not needed. * * @since 5.14.4 */ excludeFromAggregate?: Array; } export interface ISeriesPrivate extends IComponentPrivate { /** * @ignore */ chart?: Chart; startIndex?: number; endIndex?: number; adjustedStartIndex?: number; /** * Average of all data items' values (with `calculateAggregates`). */ valueAverage?: number; /** * Number of data items with a value (with `calculateAggregates`). */ valueCount?: number; /** * Sum of all data items' values (with `calculateAggregates`). */ valueSum?: number; /** * Sum of the absolute values of all data items (with `calculateAggregates`). */ valueAbsoluteSum?: number; /** * Lowest value of all data items (with `calculateAggregates`). */ valueLow?: number; /** * Highest value of all data items (with `calculateAggregates`). */ valueHigh?: number; /** * Value of the first data item that has one (with `calculateAggregates`). */ valueOpen?: number; /** * Value of the last data item that has one (with `calculateAggregates`). */ valueClose?: number; customValueAverage?: number; customValueCount?: number; customValueSum?: number; customValueAbsoluteSum?: number; customValueLow?: number; customValueHigh?: number; customValueOpen?: number; customValueClose?: number; baseValueSeries?: Series; } export interface ISeriesEvents extends IComponentEvents { } /** * Base class of all series. */ export declare abstract class Series extends Component { static className: string; static classNames: Array; _settings: ISeriesSettings; _privateSettings: ISeriesPrivate; _dataItemSettings: ISeriesDataItem; _events: ISeriesEvents; protected _aggregatesCalculated: boolean; protected _selectionAggregatesCalculated: boolean; protected _dataProcessed: boolean; protected _psi: number | undefined; protected _pei: number | undefined; protected _baseSeriesDirty: boolean; /** * The chart the series belongs to. */ chart: Chart | undefined; /** * Functions that make the series' bullets: each is called for every data * item and returns a [[Bullet]], or nothing for no bullet. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/bullets/} for more info */ bullets: List<(>(root: Root, series: Series, dataItem: D) => Bullet | undefined)>; /** * The [[Container]] that holds the series' bullets. */ readonly bulletsContainer: Container; protected _afterNew(): void; protected _dispose(): void; /** * Returns the index of the first data item in the visible range. */ startIndex(): number; /** * Returns the index after the last data item in the visible range. */ endIndex(): number; protected _handleBullets(dataItems: Array>): void; protected _makeBullets(dataItem: DataItem): void; protected _shouldMakeBullet(_dataItem: DataItem): boolean; protected _makeBullet(dataItem: DataItem, bulletFunction: (root: Root, series: Series, dataItem: DataItem) => Bullet | undefined, index?: number): Bullet | undefined; /** * Container a data item's bullets are added to. Series that lay their data * items out as separate containers can put bullets into the item itself, so * that they move with it and can be stacked among its other children. */ protected _getBulletContainer(_dataItem: DataItem): Container; protected _makeBulletReal(dataItem: DataItem, bullet: Bullet): void; /** * Makes an element open its data item's URL when clicked. * * @ignore */ _linkSprite(sprite: Sprite, dataItem: DataItem): void; /** * Opens a data item's URL in the window set by `linkTarget`. * * Override to intercept links, e.g. in an editor. * * @param dataItem Data item * @since 5.20.7 */ openUrl(dataItem: DataItem): void; /** * A bullet whose shape defines none of its own paint inherits the full set * from the series, so bullets match their series without restating the color * (like columns do). It's all-or-nothing: if the bullet sets even one of * `fill`/`fillGradient`/`fillPattern`/`stroke`/`strokeGradient`, it is left * entirely alone. Only `Graphics`-based shapes are touched; container/label/ * picture bullets are left to style their own children. * * @ignore */ _applyBulletDefaultPaint(sprite: Sprite, dataItem?: DataItem): void; /** * Adds a bullet to one data item. Unlike `series.bullets`, it takes a * [[Bullet]] instance, not a function. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/bullets/#Adding_directly_to_data_item} for more info * @since 5.6.0 * * @param dataItem Target data item * @param bullet Bullet instance */ addBullet(dataItem: DataItem, bullet: Bullet): void; protected _autoAppearReady(): boolean; _clearDirty(): void; _prepareChildren(): void; _handleRemoved(): void; /** * @ignore */ _adjustStartIndex(index: number): number; protected _calculateAggregates(startIndex: number, endIndex: number): void; _updateChildren(): void; _positionBullets(dataItem: DataItem): void; protected _hideBullets(dataItem: DataItem): void; _positionBullet(_bullet: Bullet): void; _placeBulletsContainer(chart: Chart): void; _removeBulletsContainer(): void; /** * @ignore */ disposeDataItem(dataItem: DataItem): void; protected _getItemReaderLabel(): string; /** * Shows a data item and its bullets. * * @param dataItem Data item * @param duration Animation duration in milliseconds * @return Promise */ showDataItem(dataItem: DataItem, duration?: number): Promise; /** * Hides a data item and its bullets. * * @param dataItem Data item * @param duration Animation duration in milliseconds * @return Promise */ hideDataItem(dataItem: DataItem, duration?: number): Promise; protected _sequencedShowHide(show: boolean, duration?: number): Promise; /** * @ignore */ updateLegendValue(dataItem?: DataItem): void; /** * @ignore */ updateLegendMarker(_dataItem?: DataItem): void; protected _onHide(): void; /** * @ignore */ hoverDataItem(_dataItem: DataItem): void; /** * @ignore */ unhoverDataItem(_dataItem: DataItem): void; /** * @ignore */ _getBase(key: any): number; } //# sourceMappingURL=Series.d.ts.map