/**
* DevExtreme (viz/chart_components/base_chart.d.ts)
* Version: 25.2.7
* Build date: Tue May 05 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
    UserDefinedElement,
    DxElement,
} from '../../core/element';

import {
    template,
    SingleOrMultiple,
} from '../../common';

import DataSource, { DataSourceLike } from '../../data/data_source';

import {
    EventInfo,
    NativeEventInfo,
} from '../../common/core/events';

import {
    Format,
  } from '../../localization';

import {
  basePointObject,
  baseSeriesObject,
  chartSeriesObject,
  dxChartAnnotationConfig,
} from '../chart';

import {
  BaseLegend,
} from '../common';

import BaseWidget, {
    BaseWidgetOptions,
    BaseWidgetTooltip,
    BaseWidgetAnnotationConfig,
} from '../core/base_widget';

import {
  AnimationEaseMode,
  LegendItem,
  SeriesLabel,
  SeriesPoint,
  Palette,
  PaletteExtensionMode,
} from '../../common/charts';

/**
 * Series point data shared across all series types.
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export type BasePointInfo<TPoint extends basePointObject> = {
  /**
   * The point&apos;s argument value.
   */
  argument?: string | number | Date;
  /**
   * The point&apos;s formatted argument (after argumentFormat has been applied).
   */
  argumentText?: string;
  /**
   * The point&apos;s high error value (specified in valueErrorBar.highValueField).
   */
  highErrorValue?: number;
  /**
   * The point&apos;s low error value (specified in valueErrorBar.lowValueField).
   */
  lowErrorValue?: number;
  /**
   * The point&apos;s raw argument value (set in the component data source).
   */
  originalArgument?: string | number | Date;
  /**
   * The point&apos;s raw value (set in the component data source).
   */
  originalValue?: string | number | Date;
  /**
   * Point instance of the hovered/pressed series point.
   */
  point?: TPoint;
  /**
   * An array of Point instances within the hovered/pressed series.
   */
  points?: BasePointInfo<TPoint>[];
  /**
   * The point&apos;s series name.
   */
  seriesName?: any;
  /**
   * The point&apos;s value.
   */
  value?: string | number | Date;
  /**
   * The point&apos;s formatted value (after format has been applied).
   */
  valueText?: string;
};

/**
 * 
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export interface PointInteractionInfo<TPoint extends basePointObject = basePointObject> {
    /**
     * 
     */
    readonly target: TPoint;
}

/**
 * 
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export interface TooltipInfo<TPoint extends basePointObject = basePointObject> {
    /**
     * 
     */
    target?: TPoint | dxChartAnnotationConfig | any;
}

/**
 * 
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export interface BaseChartOptions<
  TComponent,
  TPoint extends basePointObject = basePointObject,
> extends BaseWidgetOptions<TComponent> {
    /**
     * Specifies adaptive layout properties.
     */
    adaptiveLayout?: BaseChartAdaptiveLayout;
    /**
     * Specifies animation properties.
     */
    animation?: {
      /**
       * Specifies how long the animation runs in milliseconds.
       */
      duration?: number;
      /**
       * Specifies the easing function of the animation.
       */
      easing?: AnimationEaseMode;
      /**
       * Enables the animation in the UI component.
       */
      enabled?: boolean;
      /**
       * Specifies how many series points the UI component should have before the animation will be disabled.
       */
      maxPointCountSupported?: number;
    } | boolean;
    /**
     * Customizes the appearance of an individual point label.
     */
    customizeLabel?: ((pointInfo: any) => SeriesLabel);
    /**
     * Customizes the appearance of an individual series point.
     */
    customizePoint?: ((pointInfo: any) => SeriesPoint);
    /**
     * Binds the UI component to data.
     */
    dataSource?: DataSourceLike<any> | null;
    /**
     * Specifies properties of the legend.
     */
    legend?: BaseChartLegend;
    /**
     * A function that is executed when all series are ready.
     */
    onDone?: ((e: EventInfo<TComponent>) => void);
    /**
     * A function that is executed when a series point is clicked or tapped.
     */
    onPointClick?: ((e: NativeEventInfo<TComponent, MouseEvent | PointerEvent> & PointInteractionInfo<TPoint>) => void) | string;
    /**
     * A function that is executed after the pointer enters or leaves a series point.
     */
    onPointHoverChanged?: ((e: EventInfo<TComponent> & PointInteractionInfo<TPoint>) => void);
    /**
     * A function that is executed when a series point is selected or selection is canceled.
     */
    onPointSelectionChanged?: ((e: EventInfo<TComponent> & PointInteractionInfo<TPoint>) => void);
    /**
     * A function that is executed when a tooltip becomes hidden.
     */
    onTooltipHidden?: ((e: EventInfo<TComponent> & TooltipInfo<TPoint>) => void);
    /**
     * A function that is executed when a tooltip appears.
     */
    onTooltipShown?: ((e: EventInfo<TComponent> & TooltipInfo<TPoint>) => void);
    /**
     * Sets the palette to be used for colorizing series and their elements.
     */
    palette?: Array<string> | Palette;
    /**
     * Specifies what to do with colors in the palette when their number is less than the number of series (in the Chart UI component) or points in a series (in the PieChart UI component).
     */
    paletteExtensionMode?: PaletteExtensionMode;
    /**
     * Specifies whether a single point or multiple points can be selected in the chart.
     */
    pointSelectionMode?: SingleOrMultiple;
    /**
     * Specifies properties for series.
     */
    series?: any | Array<any> | undefined;
    /**
     * Configures tooltips.
     */
    tooltip?: BaseChartTooltip;
}
/**
 * Specifies adaptive layout properties.
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export interface BaseChartAdaptiveLayout {
    /**
     * Specifies the minimum container height at which the layout begins to adapt.
     */
    height?: number;
    /**
     * Specifies whether point labels should be kept when the UI component adapts the layout.
     */
    keepLabels?: boolean;
    /**
     * Specifies the minimum container width at which the layout begins to adapt.
     */
    width?: number;
}
/**
 * Specifies properties of the legend.
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export interface BaseChartLegend extends BaseLegend {
    /**
     * Allows you to change only the order, text, and visibility of legend items.
     */
    customizeItems?: ((items: Array<LegendItem>) => Array<LegendItem>);
    /**
     * Specifies an SVG element that serves as a custom legend item marker.
     */
    markerTemplate?: template | ((legendItem: LegendItem, element: SVGGElement) => string | UserDefinedElement<SVGElement>) | undefined;
}
/**
 * Configures tooltips.
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export interface BaseChartTooltip<TPointInfo = any> extends BaseWidgetTooltip {
    /**
     * Formats the point argument before it is displayed in the tooltip. To format the point value, use the format property.
     */
    argumentFormat?: Format | undefined;
    /**
     * Specifies a custom template for a tooltip.
     */
    contentTemplate?: template | ((pointInfo: TPointInfo, element: DxElement) => string | UserDefinedElement) | undefined;
    /**
     * Allows you to change tooltip appearance.
     */
    customizeTooltip?: ((pointInfo: TPointInfo) => any) | undefined;
    /**
     * Specifies whether the tooltip is shared across all series points with the same argument.
     */
    shared?: boolean;
    /**
     * Allows users to interact with the tooltip content.
     */
    interactive?: boolean;
}
/**
 * A base class for all chart UI components included in the ChartJS library.
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export class BaseChart<TProperties> extends BaseWidget<TProperties> {
    /**
     * Deselects the chart&apos;s selected series. The series is displayed in an initial style.
     */
    clearSelection(): void;
    /**
     * Gets all the series.
     */
    getAllSeries(): Array<baseSeriesObject>;
    getDataSource(): DataSource;
    /**
     * Gets a series with a specific name.
     */
    getSeriesByName(seriesName: any): chartSeriesObject;
    /**
     * Gets a series with a specific index.
     */
    getSeriesByPos(seriesIndex: number): chartSeriesObject;
    /**
     * Hides all UI component tooltips.
     */
    hideTooltip(): void;
    /**
     * Reloads data and repaints the UI component.
     */
    refresh(): void;
    render(): void;
    /**
     * Redraws the UI component.
     */
    render(renderOptions: any): void;
}

/**
 * @deprecated Use LegendItem from common/charts instead
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export type BaseChartLegendItem = LegendItem;

/**
 * 
 * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution.
 */
export interface BaseChartAnnotationConfig extends BaseWidgetAnnotationConfig {
    /**
     * Positions the annotation relative to a specific argument.
     */
    argument?: number | Date | string | undefined;
    /**
     * Anchors the annotation to a series point. Accepts the name of the point&apos;s series.
     */
    series?: string | undefined;
    /**
     * Positions the annotation relative to a value on the specified value axis.
     */
    value?: number | Date | string | undefined;
}
