Skip to content

Commit 7147da7

Browse files
Chart: rename ChartPointInfo to remove duplication in docs (DevExpress#31212)
1 parent 4731e74 commit 7147da7

File tree

14 files changed

+35
-26
lines changed

14 files changed

+35
-26
lines changed

apps/demos/Demos/Charts/AreaSelectionZooming/Angular/app/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
import { BrowserModule } from '@angular/platform-browser';
55
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
66
import { DxChartModule, DxChartComponent, DxButtonModule } from 'devextreme-angular';
7-
import { type DxChartTypes } from 'devextreme-angular/ui/chart';
7+
import type { DxChartTypes } from 'devextreme-angular/ui/chart';
88

99
import { Service, BirthLife } from './app.service';
1010

@@ -37,7 +37,7 @@ export class AppComponent {
3737
this.component.instance.resetVisualRange();
3838
}
3939

40-
customizeTooltip(pointInfo: DxChartTypes.ChartPointInfo) {
40+
customizeTooltip(pointInfo: DxChartTypes.CommonPointInfo) {
4141
const { data } = pointInfo.point;
4242
return {
4343
text: `${data.country} ${data.year}`,

apps/demos/Demos/Charts/AreaSelectionZooming/React/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Chart, {
1616
import Button from 'devextreme-react/button';
1717
import { birthLife } from './data.ts';
1818

19-
function customizeTooltip(pointInfo: ChartTypes.ChartPointInfo) {
19+
function customizeTooltip(pointInfo: ChartTypes.CommonPointInfo) {
2020
const { data } = pointInfo.point;
2121
return {
2222
text: `${data.country} ${data.year}`,

apps/demos/Demos/Charts/AreaSelectionZooming/Vue/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import { birthLife } from './data.ts';
7171
7272
const chart = ref();
7373
74-
const customizeTooltip = (pointInfo: DxChartTypes.ChartPointInfo) => {
74+
const customizeTooltip = (pointInfo: DxChartTypes.CommonPointInfo) => {
7575
const { point: { data } } = pointInfo;
7676
7777
return {

apps/demos/Demos/Charts/BiDirectionalBarChart/Angular/app/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class AppComponent {
2727
this.populationData = service.getPopulationData();
2828
}
2929

30-
customizeTooltip = ({ valueText }: { valueText: number }) => ({
31-
text: Math.abs(valueText),
30+
customizeTooltip = ({ valueText }: DxChartTypes.CommonPointInfo) => ({
31+
text: Math.abs(Number(valueText)),
3232
});
3333

3434
customizeLabel: DxChartTypes.ValueAxisLabel['customizeText'] = ({ value }) => `${Math.abs(value as number)}%`;

apps/demos/Demos/Charts/BiDirectionalBarChart/React/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import Chart, {
77
Series,
88
Tooltip,
99
Margin,
10+
type ChartTypes,
1011
} from 'devextreme-react/chart';
1112
import { dataSource } from './data.ts';
1213

13-
function customizeTooltip(e: { valueText: number; }) {
14-
return { text: Math.abs(e.valueText) };
14+
function customizeTooltip(e: ChartTypes.CommonPointInfo) {
15+
return { text: Math.abs(Number(e.valueText)) };
1516
}
1617

1718
function customizeLabel(e: { value: Date | number | string }) {

apps/demos/Demos/Charts/BiDirectionalBarChart/ReactJs/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Chart, {
1111
import { dataSource } from './data.js';
1212

1313
function customizeTooltip(e) {
14-
return { text: Math.abs(e.valueText) };
14+
return { text: Math.abs(Number(e.valueText)) };
1515
}
1616
function customizeLabel(e) {
1717
return `${Math.abs(e.value)}%`;

apps/demos/Demos/Charts/BiDirectionalBarChart/Vue/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ import DxChart, {
4242
DxLegend,
4343
DxSeries,
4444
DxTooltip,
45+
type DxChartTypes,
4546
} from 'devextreme-vue/chart';
4647
import { dataSource } from './data.ts';
4748
48-
const customizeTooltip = ({ valueText }) => ({ text: Math.abs(valueText) });
49+
const customizeTooltip = (e: DxChartTypes.CommonPointInfo) => ({
50+
text: Math.abs(Number(e.valueText)),
51+
});
4952
const customizeLabel = ({ value }) => `${Math.abs(value)}%`;
5053
</script>
5154
<style>

apps/demos/Demos/Charts/SideBySideFullStackedBar/Angular/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NgModule, Component, enableProdMode } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
4+
import type { DxChartTypes } from 'devextreme-angular/ui/chart';
45

56
import { DxChartModule } from 'devextreme-angular';
67

@@ -29,7 +30,7 @@ export class AppComponent {
2930
this.populationData = service.getPopulationData();
3031
}
3132

32-
customizeTooltip = ({ valueText, percentText }) => (
33+
customizeTooltip = ({ valueText, percentText }: DxChartTypes.StackedPointInfo) => (
3334
{
3435
text: `${percentText} - ${valueText}`,
3536
}

apps/demos/Demos/Charts/SideBySideFullStackedBar/React/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from 'react';
22
import {
3-
Chart, Series, CommonSeriesSettings, Legend, Export, Tooltip, ITooltipProps,
3+
Chart, Series, CommonSeriesSettings, Legend, Export, Tooltip, ITooltipProps, ChartTypes,
44
} from 'devextreme-react/chart';
55
import service from './data.ts';
66

77
const dataSource = service.getMaleAgeData();
88

9-
const customizeTooltip: ITooltipProps['customizeTooltip'] = (arg) => ({
9+
const customizeTooltip: ITooltipProps['customizeTooltip'] = (arg: ChartTypes.StackedPointInfo) => ({
1010
text: `${arg.percentText} - ${arg.valueText}`,
1111
});
1212

apps/demos/Demos/Charts/SideBySideFullStackedBar/Vue/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ import {
5757
DxLegend,
5858
DxExport,
5959
DxTooltip,
60+
type DxChartTypes,
6061
} from 'devextreme-vue/chart';
6162
import service from './data.ts';
6263
6364
const dataSource = service.getMaleAgeData();
6465
65-
const customizeTooltip = ({ percentText, valueText }) => ({ text: `${percentText} - ${valueText}` });
66+
const customizeTooltip = (
67+
{ percentText, valueText }: DxChartTypes.StackedPointInfo,
68+
) => ({ text: `${percentText} - ${valueText}` });
6669
</script>
6770
<style>
6871
#chart {

0 commit comments

Comments
 (0)