import type { IBarSeries } from '../..'; import { Axis, CategoryAxis, PlotModel } from '../..'; /** * Represents a manager for bar series. * This handles all operations that need information about all bar series in the plot that share the same axes. This includes: * - determine and keep track of bar width and offset * - determine and keep track of stacked bar offsets */ export declare class BarSeriesManager { /** * The current offset of the bars (not used for stacked bar series). * These offsets are modified during rendering. */ private currentBarOffset?; /** * The current max value per StackIndex and Label. * These values are modified during rendering. */ private currentMaxValue?; /** * The current min value per StackIndex and Label. * These values are modified during rendering. */ private currentMinValue?; /** * The base value per StackIndex and Label for negative values of stacked bar series. * These values are modified during rendering. */ private currentNegativeBaseValues?; /** * The base value per StackIndex and Label for positive values of stacked bar series. * These values are modified during rendering. */ private currentPositiveBaseValues?; /** * The maximal width of all labels. */ private maxWidth; /** * Initializes a new instance of the BarSeriesManager class. * @param categoryAxis The category axis the series belong to. * @param valueAxis The value axis the series belong to. * @param series The bar series this instance should manage. */ constructor(categoryAxis: CategoryAxis, valueAxis: Axis, series: IBarSeries[]); private readonly _categoryAxis; /** * Gets the CategoryAxis whose bar series this instance manages. */ get categoryAxis(): CategoryAxis; private readonly _series; /** * Gets all bar series that are managed by this instance. */ get managedSeries(): IBarSeries[]; /** * Gets the PlotModel whose bar series this instance manages. */ get plotModel(): PlotModel; private readonly _valueAxis; /** * Gets the value Axis whose bar series this instance manages. */ get valueAxis(): Axis; /** * Gets the string representation of the categories. */ get categories(): string[]; /** * The offset of the bars. */ private _barOffset?; /** * The offset of the bars per StackIndex and Label (only used for stacked bar series). */ private _stackedBarOffset?; private _stackIndexMapping; /** * Gets the stack index mapping. The mapping indicates to which rank a specific stack index belongs. */ private get stackIndexMapping(); /** * Gets the category value. * @param categoryIndex Index of the category. * @param stackIndex Index of the stack. * @param actualBarWidth Actual width of the bar. * @returns The get category value. */ getCategoryValue(categoryIndex: number, stackIndex: number, actualBarWidth: number): number; /** * Gets the current bar offset for the specified category index. * @param categoryIndex The category index. * @returns The offset. */ getCurrentBarOffset(categoryIndex: number): number; /** * Gets the current base value for the specified stack and category index. * @param stackIndex The stack index. * @param categoryIndex The category index. * @param negativeValue if set to true get the base value for negative values. * @returns The current base value. */ getCurrentBaseValue(stackIndex: number, categoryIndex: number, negativeValue: boolean): number; /** * Gets the current maximum value for the specified stack and category index. * @param stackIndex The stack index. * @param categoryIndex The category index. * @returns The current value. */ getCurrentMaxValue(stackIndex: number, categoryIndex: number): number; /** * Gets the current minimum value for the specified stack and category index. * @param stackIndex The stack index. * @param categoryIndex The category index. * @returns The current value. */ getCurrentMinValue(stackIndex: number, categoryIndex: number): number; /** * Gets the maximum width of all category labels. * @returns The maximum width. */ getMaxWidth(): number; /** * Gets the stack index for the specified stack group. * @param stackGroup The stack group. * @returns The stack index. */ getStackIndex(stackGroup: string): number; /** * Increases the current bar offset for the specified category index. * @param categoryIndex The category index. * @param delta The offset increase. */ increaseCurrentBarOffset(categoryIndex: number, delta: number): void; /** * Initializes the manager for rendering. This should be called before any of the managed series are rendered. */ initializeRender(): void; /** * Sets the current base value for the specified stack and category index. * @param stackIndex Index of the stack. * @param categoryIndex Index of the category. * @param negativeValue if set to true set the base value for negative values. * @param newValue The new value. */ setCurrentBaseValue(stackIndex: number, categoryIndex: number, negativeValue: boolean, newValue: number): void; /** * Sets the current maximum value for the specified stack and category index. * @param stackIndex The stack index. * @param categoryIndex The category index. * @param newValue The new value. */ setCurrentMaxValue(stackIndex: number, categoryIndex: number, newValue: number): void; /** * Sets the current minimum value for the specified stack and category index. * @param stackIndex The stack index. * @param categoryIndex The category index. * @param newValue The new value. */ setCurrentMinValue(stackIndex: number, categoryIndex: number, newValue: number): void; /** * Bar series should call this after they updated their data. */ update(): void; /** * Gets a value indicating whether the bar series has an item at the specified category index. * @param series The bar series. * @param categoryIndex The category index. * @returns true if the bar series has an item at the specified category index; false otherwise. */ private static hasCategory; /** * Resets the current values. * The current values may be modified during update of max/min and rendering. */ private resetCurrentValues; /** * Updates the bar offsets. */ private updateBarOffsets; /** * Updates the valid data of all managed series. */ private updateValidData; } //# sourceMappingURL=BarSeriesManager.d.ts.map