UNPKG

@amcharts/amcharts5

Version:
168 lines 6.93 kB
import type { DataItem } from "../../../core/render/Component"; import type { Graphics } from "../../../core/render/Graphics"; import type { ListTemplate } from "../../../core/util/List"; import type { IAxisDataItem } from "../axes/Axis"; import type { ILegendDataItem } from "../../../core/render/Legend"; import type { Sprite } from "../../../core/render/Sprite"; import type { Color } from "../../../core/util/Color"; import { XYSeries, IXYSeriesPrivate, IXYSeriesSettings, IXYSeriesDataItem, IXYSeriesAxisRange } from "./XYSeries"; import { ColorSet } from "../../../core/util/ColorSet"; export interface IBaseColumnSeriesDataItem extends IXYSeriesDataItem { /** * Color of the column, when the series colors each data item separately. * * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/column-series/} for more info * @since 5.20.4 */ fill?: Color; /** * An actual [[Graphics]] element (Column/Slice/Candlestick/OHLC). */ graphics?: Graphics; /** * In case axis ranges are added to the series, it creates a separate * element ([[Graphics]]) for each axis range. This array holds them all. */ rangeGraphics?: Array<Graphics>; /** * If data items from this series are used to feed a [[Legend]], this * will hold a reference to the equivalent Legend data item. * * @see {@link https://www.amcharts.com/docs/v5/concepts/legend/#Data_item_list} for more info */ legendDataItem?: DataItem<ILegendDataItem>; } export interface IBaseColumnSeriesSettings extends IXYSeriesSettings { /** * Indicates if series must divvy up available space with other column * series (`true`; default) or take up the whole available space (`false`). * * @default true * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/column-series/#Clustering} for more info */ clustered?: boolean; /** * Whether positions of bullets should be calculated based on portion of * column currently visual (`true`) or the whole length/height of the * column (`false`). * * @default true */ adjustBulletPosition?: boolean; /** * If set to `true`, each column gets its own color from `colors`, instead of * the whole series sharing one color. * * @default false * @since 5.20.4 */ colorByDataItem?: boolean; /** * A [[ColorSet]] to take colors from when `colorByDataItem` is set. * * The series makes its own if none is given, rather than taking the chart's: * the chart's palette is stepped once per series, and one palette per series * also means editing one does not change the others. * * @since 5.20.4 */ colors?: ColorSet; /** * If set to `true` will use color of the last visible column for legend * marker. Otherwise, series `fill`/`stroke` will be used. * * @since 5.1.13 */ useLastColorForLegendMarker?: boolean; } export interface IBaseColumnSeriesPrivate extends IXYSeriesPrivate { } export interface IBaseColumnSeriesAxisRange extends IXYSeriesAxisRange { /** * A list of actual [[Graphics]] elements for an axis range. * * Can be used to adjust the look of the axis range columns. */ columns: ListTemplate<Graphics>; } /** * Base class for all "column-based" series */ export declare abstract class BaseColumnSeries extends XYSeries { _settings: IBaseColumnSeriesSettings; _privateSettings: IBaseColumnSeriesPrivate; _dataItemSettings: IBaseColumnSeriesDataItem; _axisRangeType: IBaseColumnSeriesAxisRange; static className: string; static classNames: Array<string>; /** * @ignore */ abstract makeColumn(dataItem: DataItem<this["_dataItemSettings"]>, listTemplate: ListTemplate<Graphics>): Graphics; /** * ListTemplate of columns in series. */ abstract columns: ListTemplate<Graphics>; protected _makeGraphics(listTemplate: ListTemplate<Graphics>, dataItem: DataItem<this["_dataItemSettings"]>): Graphics; protected _ph: number; protected _pw: number; protected _columnsUpdated: boolean; _makeFieldNames(): void; _prepareChildren(): void; _updateChildren(): void; _afterChanged(): void; protected _beforeColumnsDraw(): void; protected _afterColumnsDraw(): void; /** * The palette each column is colored from. Made on demand so every series * gets its own - a themed one would be a single instance shared by all of * them. * * @ignore */ protected _afterNew(): void; protected _colorSet(): ColorSet; /** * Gives every column its own color, by data item index. * * By index rather than by stepping the palette, so the colors do not depend * on how many times the data has been set, survive a theme being applied * again, and are there for data items the axis groups together. * * @ignore */ protected _colorColumns(): void; protected _createGraphics(dataItem: DataItem<this["_dataItemSettings"]>): void; createAxisRange(axisDataItem: DataItem<IAxisDataItem>): this["_axisRangeType"]; protected _updateGraphics(dataItem: DataItem<this["_dataItemSettings"]>, previousDataItem: DataItem<this["_dataItemSettings"]>, axisCase: 0 | 1 | 2): void; protected _updateSeriesGraphics(dataItem: DataItem<this["_dataItemSettings"]>, graphics: Graphics, l: number, r: number, t: number, b: number, fitW: boolean, fitH: boolean): void; protected _handleDataSetChange(): void; _applyGraphicsStates(dataItem: DataItem<this["_dataItemSettings"]>, previousDataItem: DataItem<this["_dataItemSettings"]>): void; /** * @ignore */ disposeDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void; /** * Hides series's data item. * * @param dataItem Data item * @param duration Animation duration in milliseconds * @return Promise */ hideDataItem(dataItem: DataItem<this["_dataItemSettings"]>, duration?: number): Promise<void>; protected _toggleColumn(dataItem: DataItem<this["_dataItemSettings"]>, visible: boolean): void; /** * Shows series's data item. * * @param dataItem Data item * @param duration Animation duration in milliseconds * @return Promise */ showDataItem(dataItem: DataItem<this["_dataItemSettings"]>, duration?: number): Promise<void>; /** * @ignore */ updateLegendMarker(dataItem?: DataItem<IBaseColumnSeriesDataItem>): void; protected _getTooltipTarget(dataItem: DataItem<this["_dataItemSettings"]>): Sprite; } //# sourceMappingURL=BaseColumnSeries.d.ts.map