diff --git a/packages/devextreme-angular/src/common/charts.ts b/packages/devextreme-angular/src/common/charts.ts index b1c62de3dd62..d20b662060ee 100644 --- a/packages/devextreme-angular/src/common/charts.ts +++ b/packages/devextreme-angular/src/common/charts.ts @@ -15,6 +15,7 @@ export { LabelOverlap, LabelPosition, LegendHoverMode, + LegendItem, LegendMarkerState, Palette, PaletteColorSet, diff --git a/packages/devextreme-react/src/chart.ts b/packages/devextreme-react/src/chart.ts index c925967ee905..e1f75ec216a5 100644 --- a/packages/devextreme-react/src/chart.ts +++ b/packages/devextreme-react/src/chart.ts @@ -8,9 +8,8 @@ import { Component as BaseComponent, IHtmlOptions } from "./core/component"; import NestedOption from "./core/nested-option"; import type { ArgumentAxisClickEvent, DisposingEvent, DoneEvent, DrawnEvent, ExportedEvent, ExportingEvent, FileSavingEvent, IncidentOccurredEvent, InitializedEvent, LegendClickEvent, PointClickEvent, SeriesClickEvent, TooltipHiddenEvent, TooltipShownEvent, ZoomEndEvent, ZoomStartEvent, chartPointAggregationInfoObject, chartSeriesObject, dxChartAnnotationConfig, chartPointObject } from "devextreme/viz/chart"; -import type { Font as ChartsFont, ScaleBreak, ChartsColor } from "devextreme/common/charts"; +import type { Font as ChartsFont, ScaleBreak, ChartsColor, LegendItem } from "devextreme/common/charts"; import type { template } from "devextreme/core/templates/template"; -import type { BaseChartLegendItem } from "devextreme/viz/chart_components/base_chart"; import type { ChartSeries } from "devextreme/viz/common"; import type * as CommonChartTypes from "devextreme/common/charts"; @@ -1861,7 +1860,7 @@ type ILegendProps = React.PropsWithChildren<{ columnCount?: number; columnItemSpacing?: number; customizeHint?: ((seriesInfo: { seriesColor: string, seriesIndex: number, seriesName: any }) => string); - customizeItems?: ((items: Array) => Array); + customizeItems?: ((items: Array) => Array); customizeText?: ((seriesInfo: { seriesColor: string, seriesIndex: number, seriesName: any }) => string); font?: ChartsFont; horizontalAlignment?: "center" | "left" | "right"; @@ -1875,7 +1874,7 @@ type ILegendProps = React.PropsWithChildren<{ top?: number; }; markerSize?: number; - markerTemplate?: ((legendItem: BaseChartLegendItem, element: any) => string | any) | template; + markerTemplate?: ((legendItem: LegendItem, element: any) => string | any) | template; orientation?: "horizontal" | "vertical"; paddingLeftRight?: number; paddingTopBottom?: number; diff --git a/packages/devextreme-react/src/common/charts.ts b/packages/devextreme-react/src/common/charts.ts index 6278bb0cf734..baea802dcb73 100644 --- a/packages/devextreme-react/src/common/charts.ts +++ b/packages/devextreme-react/src/common/charts.ts @@ -15,6 +15,7 @@ export { LabelOverlap, LabelPosition, LegendHoverMode, + LegendItem, LegendMarkerState, Palette, PaletteColorSet, diff --git a/packages/devextreme-react/src/polar-chart.ts b/packages/devextreme-react/src/polar-chart.ts index 309b8a2b0979..f349ea233808 100644 --- a/packages/devextreme-react/src/polar-chart.ts +++ b/packages/devextreme-react/src/polar-chart.ts @@ -8,9 +8,8 @@ import { Component as BaseComponent, IHtmlOptions } from "./core/component"; import NestedOption from "./core/nested-option"; import type { ArgumentAxisClickEvent, DisposingEvent, DoneEvent, DrawnEvent, ExportedEvent, ExportingEvent, FileSavingEvent, IncidentOccurredEvent, InitializedEvent, LegendClickEvent, PointClickEvent, SeriesClickEvent, TooltipHiddenEvent, TooltipShownEvent, ZoomEndEvent, ZoomStartEvent, dxPolarChartAnnotationConfig, dxPolarChartCommonAnnotationConfig, PolarChartSeries } from "devextreme/viz/polar_chart"; -import type { Font as ChartsFont, ChartsColor } from "devextreme/common/charts"; +import type { Font as ChartsFont, ChartsColor, LegendItem } from "devextreme/common/charts"; import type { template } from "devextreme/core/templates/template"; -import type { BaseChartLegendItem } from "devextreme/viz/chart_components/base_chart"; import type * as CommonChartTypes from "devextreme/common/charts"; import type * as LocalizationTypes from "devextreme/localization"; @@ -1267,7 +1266,7 @@ type ILegendProps = React.PropsWithChildren<{ columnCount?: number; columnItemSpacing?: number; customizeHint?: ((seriesInfo: { seriesColor: string, seriesIndex: number, seriesName: any }) => string); - customizeItems?: ((items: Array) => Array); + customizeItems?: ((items: Array) => Array); customizeText?: ((seriesInfo: { seriesColor: string, seriesIndex: number, seriesName: any }) => string); font?: ChartsFont; horizontalAlignment?: "center" | "left" | "right"; @@ -1281,7 +1280,7 @@ type ILegendProps = React.PropsWithChildren<{ top?: number; }; markerSize?: number; - markerTemplate?: ((legendItem: BaseChartLegendItem, element: any) => string | any) | template; + markerTemplate?: ((legendItem: LegendItem, element: any) => string | any) | template; orientation?: "horizontal" | "vertical"; paddingLeftRight?: number; paddingTopBottom?: number; diff --git a/packages/devextreme-vue/src/common/charts.ts b/packages/devextreme-vue/src/common/charts.ts index 6278bb0cf734..baea802dcb73 100644 --- a/packages/devextreme-vue/src/common/charts.ts +++ b/packages/devextreme-vue/src/common/charts.ts @@ -15,6 +15,7 @@ export { LabelOverlap, LabelPosition, LegendHoverMode, + LegendItem, LegendMarkerState, Palette, PaletteColorSet, diff --git a/packages/devextreme/js/common/charts.d.ts b/packages/devextreme/js/common/charts.d.ts index 3bd22ca1d197..d04ce2afb471 100644 --- a/packages/devextreme/js/common/charts.d.ts +++ b/packages/devextreme/js/common/charts.d.ts @@ -1,5 +1,7 @@ import { HorizontalAlignment } from '../common'; import { Format } from '../localization'; +import { BaseLegendItem } from '../viz/common'; +import { baseSeriesObject } from '../viz/chart'; /** * @public @@ -739,3 +741,18 @@ export interface SeriesLabel { */ displayFormat?: string; } + +/** + * @public + * @docid + * @type object + * @inherits BaseLegendItem + * @namespace DevExpress.viz + */ +export interface LegendItem extends BaseLegendItem { + /** + * @docid + * @public + */ + series?: baseSeriesObject; +} diff --git a/packages/devextreme/js/viz/chart_components/base_chart.d.ts b/packages/devextreme/js/viz/chart_components/base_chart.d.ts index eb00cec544c9..84219173b857 100644 --- a/packages/devextreme/js/viz/chart_components/base_chart.d.ts +++ b/packages/devextreme/js/viz/chart_components/base_chart.d.ts @@ -27,7 +27,6 @@ import { import { BaseLegend, - BaseLegendItem, } from '../common'; import BaseWidget, { @@ -37,11 +36,12 @@ import BaseWidget, { } from '../core/base_widget'; import { - AnimationEaseMode, - SeriesLabel, - SeriesPoint, - Palette, - PaletteExtensionMode, + AnimationEaseMode, + LegendItem, + SeriesLabel, + SeriesPoint, + Palette, + PaletteExtensionMode, } from '../../common/charts'; import { @@ -261,14 +261,14 @@ export interface BaseChartLegend extends BaseLegend { * @docid BaseChartOptions.legend.customizeItems * @public */ - customizeItems?: ((items: Array) => Array); + customizeItems?: ((items: Array) => Array); /** * @docid BaseChartOptions.legend.markerTemplate * @default undefined * @type_function_return string|SVGElement|jQuery * @public */ - markerTemplate?: template | ((legendItem: BaseChartLegendItem, element: SVGGElement) => string | UserDefinedElement); + markerTemplate?: template | ((legendItem: LegendItem, element: SVGGElement) => string | UserDefinedElement); } /** * @hidden @@ -367,20 +367,6 @@ export class BaseChart extends BaseWidget { render(renderOptions: any): void; } -/** - * @docid - * @type object - * @inherits BaseLegendItem - * @namespace DevExpress.viz - */ -export interface BaseChartLegendItem extends BaseLegendItem { - /** - * @docid - * @public - */ - series?: baseSeriesObject; -} - /** * @docid * @type object diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index 5c6a5fe47663..b3fa1b1e4986 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -30592,30 +30592,17 @@ declare module DevExpress.viz { /** * [descr:BaseChartOptions.legend.customizeItems] */ - customizeItems?: ( - items: Array - ) => Array; + customizeItems?: (items: Array) => Array; /** * [descr:BaseChartOptions.legend.markerTemplate] */ markerTemplate?: | DevExpress.core.template | (( - legendItem: BaseChartLegendItem, + legendItem: LegendItem, element: SVGGElement ) => string | DevExpress.core.UserDefinedElement); } - /** - * [descr:BaseChartLegendItem] - * @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 BaseChartLegendItem - extends DevExpress.common.charts.BaseLegendItem { - /** - * [descr:BaseChartLegendItem.series] - */ - series?: baseSeriesObject; - } /** * [descr:BaseChartOptions] * @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. @@ -41837,6 +41824,15 @@ declare module DevExpress.viz { * [descr:viz.getTheme(theme)] */ export function getTheme(theme: string): any; + /** + * [descr:LegendItem] + */ + export interface LegendItem extends DevExpress.common.charts.BaseLegendItem { + /** + * [descr:LegendItem.series] + */ + series?: baseSeriesObject; + } /** * [descr:MapLayer] * @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.