Tooltip in React 3D Charts

The 3D Chart will display details about the points through tooltip, when the mouse is moved over the specific point.

Enable tooltip

The tooltip is useful when you cannot display information by using the data labels due to space constraints. You can enable tooltip by setting the enable property as true in tooltip object and by injecting Tooltip3D module into the services.

import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Inject, Legend3D, DataLabel3D, Category3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

export let data = [
    { x: 'Tesla', y: 137429 },
    { x: 'Aion', y: 80308 },
    { x: 'Wuling', y: 76418 },
    { x: 'Changan', y: 52849 },
    { x: 'Geely', y: 47234 },
    { x: 'Nio', y: 31041 },
    { x: 'Neta', y: 22449 },
    { x: 'BMW', y: 18733 }
];

function App() {
    return (<Chart3DComponent id='charts' style= primaryXAxis=
        wallColor='transparent'
        primaryYAxis= enableRotation={true} rotation={7} tilt={10} depth={100} tooltip= legendSettings=>
        <Inject services={[ColumnSeries3D, Legend3D, Tooltip3D, Category3D, DataLabel3D, Highlight3D]} />
        <Chart3DSeriesCollectionDirective >
            <Chart3DSeriesDirective dataSource={data} xName='x' name='Sales' yName='y' type='Column'>
            </Chart3DSeriesDirective>
        </Chart3DSeriesCollectionDirective>
    </Chart3DComponent>);
}
;
export default App;

const root = ReactDOM.createRoot(document.getElementById('charts'));
root.render(<App />);
import { Category3D, Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, DataLabel3D, Highlight3D, ColumnSeries3D, Legend3D, Tooltip3D, Inject } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

export let data: Object[] = [
  { x: 'Tesla', y: 137429 },
  { x: 'Aion', y: 80308 },
  { x: 'Wuling', y: 76418 },
  { x: 'Changan', y: 52849 },
  { x: 'Geely', y: 47234 },
  { x: 'Nio', y: 31041 },
  { x: 'Neta', y: 22449 },
  { x: 'BMW', y: 18733 }
];


function App() {
  return (<Chart3DComponent id='charts' style= primaryXAxis=
    wallColor='transparent'
    primaryYAxis= enableRotation={true} rotation={7} tilt={10} depth={100} tooltip= legendSettings=>
    <Inject services={[ColumnSeries3D, Legend3D, Tooltip3D, DataLabel3D, Category3D, Highlight3D]} />
    <Chart3DSeriesCollectionDirective >
      <Chart3DSeriesDirective dataSource={data} xName='x' name='Sales' yName='y' type='Column'>
      </Chart3DSeriesDirective>
    </Chart3DSeriesCollectionDirective>
  </Chart3DComponent>)
};
export default App;

const root = ReactDOM.createRoot(document.getElementById('charts'));
root.render(<App />);

Fixed tooltip

By default, tooltip track the mouse movement, but the tooltip can be set in fixed position by using the location property.

import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Legend3D, DataLabel3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { country: "USA", gold: 50, silver: 70, bronze: 45 },
        { country: "China", gold: 40, silver: 60, bronze: 55 },
        { country: "Japan", gold: 70, silver: 60, bronze: 50 },
        { country: "Australia", gold: 60, silver: 56, bronze: 40 },
        { country: "France", gold: 50, silver: 45, bronze: 35 },
        { country: "Germany", gold: 40, silver: 30, bronze: 22 },
        { country: "Italy", gold: 40, silver: 35, bronze: 37 },
        { country: "Sweden", gold: 30, silver: 25, bronze: 27 }
    ];
    const tooltip = { location: { x: 120, y: 20 }, enable: true };
    return <Chart3DComponent id='charts' primaryXAxis=
        tooltip={tooltip}
            wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, Category3D, Legend3D, Tooltip3D, DataLabel3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='country' yName='gold' type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Legend3D, DataLabel3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { country: "USA", gold: 50, silver: 70, bronze: 45 },
        { country: "China", gold: 40, silver: 60, bronze: 55 },
        { country: "Japan", gold: 70, silver: 60, bronze: 50 },
        { country: "Australia", gold: 60, silver: 56, bronze: 40 },
        { country: "France", gold: 50, silver: 45, bronze: 35 },
        { country: "Germany", gold: 40, silver: 30, bronze: 22 },
        { country: "Italy", gold: 40, silver: 35, bronze: 37 },
        { country: "Sweden", gold: 30, silver: 25, bronze: 27 }
    ];
    const tooltip = { location: { x: 120, y: 20 }, enable: true };
    return <Chart3DComponent id='charts' primaryXAxis=
        tooltip={tooltip}
            wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, Category3D, Legend3D, Tooltip3D, DataLabel3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='country' yName='gold' type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));

Format the tooltip

By default, tooltip shows information of x and y value in points. In addition to that, more information can be shown in tooltip by using the format property. For example the format ${series.name} : ${point.y} shows series name and point y value.

import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Legend3D, DataLabel3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { country: "USA", gold: 50, silver: 70, bronze: 45 },
        { country: "China", gold: 40, silver: 60, bronze: 55 },
        { country: "Japan", gold: 70, silver: 60, bronze: 50 },
        { country: "Australia", gold: 60, silver: 56, bronze: 40 },
        { country: "France", gold: 50, silver: 45, bronze: 35 },
        { country: "Germany", gold: 40, silver: 30, bronze: 22 },
        { country: "Italy", gold: 40, silver: 35, bronze: 37 },
        { country: "Sweden", gold: 30, silver: 25, bronze: 27 }
    ];
    const tooltip = { enable: true,
        header: 'Unemployment',
        format: '<b>${series.name} : ${point.y}</b>' };
    return <Chart3DComponent id='charts' primaryXAxis=
        tooltip={tooltip}
            wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, Category3D, Legend3D, Tooltip3D, DataLabel3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='country' yName='gold' name="Country" type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Legend3D, DataLabel3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { country: "USA", gold: 50, silver: 70, bronze: 45 },
        { country: "China", gold: 40, silver: 60, bronze: 55 },
        { country: "Japan", gold: 70, silver: 60, bronze: 50 },
        { country: "Australia", gold: 60, silver: 56, bronze: 40 },
        { country: "France", gold: 50, silver: 45, bronze: 35 },
        { country: "Germany", gold: 40, silver: 30, bronze: 22 },
        { country: "Italy", gold: 40, silver: 35, bronze: 37 },
        { country: "Sweden", gold: 30, silver: 25, bronze: 27 }
    ];
    const tooltip = { enable: true,
        header: 'Unemployment',
        format: '<b>${series.name} : ${point.y}</b>' };
    return <Chart3DComponent id='charts' primaryXAxis=
        tooltip={tooltip}
            wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, Category3D, Legend3D, Tooltip3D, DataLabel3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='country' yName='gold' name="Country" type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));

Inline tooltip formatting

The tooltip content can be formatted directly within the format property by adding DateTime or number format specifiers to supported tooltip tokens. This allows you to control how point and series values are displayed without using additional events.

A format specifier can be applied to a tooltip token by adding a colon (:) followed by the required format.

For example:

const tooltip = {
    enable: true,
    format: '${series.name} (${series.type})<br>${point.x:MMM yyyy} : ${point.y:n2}<br>Opacity: ${series.opacity}'
};

In the above example, point.x is displayed in month-year format, point.y is displayed with two decimal places, and series.opacity displays the opacity value applied to the series.

Inline formatting can be applied to the following tooltip tokens:

  • point.x – Specifies the x-value of the data point, such as DateTime or category values.
  • point.y – Specifies the numeric y-value of the data point.
  • series.name – Specifies the name assigned to the series.
  • series.type – Specifies the rendering type of the series, such as Column, Bar, Line, or StackingColumn.
  • series.opacity – Specifies the opacity value applied to the series. This value controls the visual transparency of the series and can be customized in the series configuration.

Important: The availability of point-specific tokens depends on the values configured in the data source and the 3D chart series type. The series.name and series.type tokens return string values, so DateTime or number formatting is not applied to these tokens.

The following format types are supported:

  • DateTime formats such as MMM yyyy, MM:yy, and dd MMM
  • Number formats such as:
    • n2 – number with two decimal places
    • n0 – number without decimal places
    • c2 – currency format
    • p1 – percentage format
    • e1 – exponential notation

If the specified format does not match the resolved value type, the original value is displayed.

import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, DateTime3D, Inject, Legend3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { month: new Date(2024, 0, 1), sales: 35 },
        { month: new Date(2024, 1, 1), sales: 28 },
        { month: new Date(2024, 2, 1), sales: 34 },
        { month: new Date(2024, 3, 1), sales: 32 },
        { month: new Date(2024, 4, 1), sales: 40 },
        { month: new Date(2024, 5, 1), sales: 32 },
        { month: new Date(2024, 6, 1), sales: 35 },
        { month: new Date(2024, 7, 1), sales: 55 },
        { month: new Date(2024, 8, 1), sales: 38 },
        { month: new Date(2024, 9, 1), sales: 30 },
        { month: new Date(2024, 10, 1), sales: 25 },
        { month: new Date(2024, 11, 1), sales: 32 }
    ];
    const tooltip = {
        enable: true,
        header: 'Sales',
        format: '<b>${series.name}</b><br>${point.x:MMM yyyy} : ${point.y:n2}'
    };
    const primaryXAxis = {
        valueType: "DateTime",
        labelRotation: -45,
        labelPlacement: 'BetweenTicks'
    }
    return <Chart3DComponent id='charts' primaryXAxis={primaryXAxis} tooltip={tooltip} wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, DateTime3D, Legend3D, Tooltip3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='month' yName='sales' name="Sales" type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, DateTime3D, Inject, Legend3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { month: new Date(2024, 0, 1), sales: 35 },
        { month: new Date(2024, 1, 1), sales: 28 },
        { month: new Date(2024, 2, 1), sales: 34 },
        { month: new Date(2024, 3, 1), sales: 32 },
        { month: new Date(2024, 4, 1), sales: 40 },
        { month: new Date(2024, 5, 1), sales: 32 },
        { month: new Date(2024, 6, 1), sales: 35 },
        { month: new Date(2024, 7, 1), sales: 55 },
        { month: new Date(2024, 8, 1), sales: 38 },
        { month: new Date(2024, 9, 1), sales: 30 },
        { month: new Date(2024, 10, 1), sales: 25 },
        { month: new Date(2024, 11, 1), sales: 32 }
    ];
    const tooltip = {
        enable: true,
        header: 'Sales',
        format: '<b>${series.name}</b><br>${point.x:MMM yyyy} : ${point.y:n2}'
    };
    const primaryXAxis = {
        valueType: "DateTime",
        labelRotation: -45,
        labelPlacement: 'BetweenTicks'
    }
    return <Chart3DComponent id='charts' primaryXAxis={primaryXAxis} tooltip={tooltip} wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, DateTime3D, Legend3D, Tooltip3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='month' yName='sales' name="Sales" type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));

Tooltip template

Any HTML elements can be displayed in the tooltip by using the template property of the tooltip. The ${x} and ${y} can be used as place holders in the HTML element to display the x and y values of the corresponding data point.

import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Legend3D, DataLabel3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { country: "USA", gold: 50, silver: 70, bronze: 45 },
        { country: "China", gold: 40, silver: 60, bronze: 55 },
        { country: "Japan", gold: 70, silver: 60, bronze: 50 },
        { country: "Australia", gold: 60, silver: 56, bronze: 40 },
        { country: "France", gold: 50, silver: 45, bronze: 35 },
        { country: "Germany", gold: 40, silver: 30, bronze: 22 },
        { country: "Italy", gold: 40, silver: 35, bronze: 37 },
        { country: "Sweden", gold: 30, silver: 25, bronze: 27 }
    ];
    const tooltip = { enable: true,
        template: "<div id='templateWrap'><table style='width:100%;  border: 1px solid black;'><tr><th colspan='2' bgcolor='#00FFFF'>Unemployment</th></tr><tr><td bgcolor='#00FFFF'>${x}:</td><td bgcolor='#00FFFF'>${y}</td></tr></table></div>" };
    return <Chart3DComponent id='charts' primaryXAxis=
        tooltip={tooltip}
            wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, Category3D, Legend3D, Tooltip3D, DataLabel3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='country' yName='gold' name="Country" type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Legend3D, DataLabel3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { country: "USA", gold: 50, silver: 70, bronze: 45 },
        { country: "China", gold: 40, silver: 60, bronze: 55 },
        { country: "Japan", gold: 70, silver: 60, bronze: 50 },
        { country: "Australia", gold: 60, silver: 56, bronze: 40 },
        { country: "France", gold: 50, silver: 45, bronze: 35 },
        { country: "Germany", gold: 40, silver: 30, bronze: 22 },
        { country: "Italy", gold: 40, silver: 35, bronze: 37 },
        { country: "Sweden", gold: 30, silver: 25, bronze: 27 }
    ];
    const tooltip = { enable: true,
        template: "<div id='templateWrap'><table style='width:100%;  border: 1px solid black;'><tr><th colspan='2' bgcolor='#00FFFF'>Unemployment</th></tr><tr><td bgcolor='#00FFFF'>${x}:</td><td bgcolor='#00FFFF'>${y}</td></tr></table></div>" };
    return <Chart3DComponent id='charts' primaryXAxis=
        tooltip={tooltip}
            wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, Category3D, Legend3D, Tooltip3D, DataLabel3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='country' yName='gold' name="Country" type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));

Customize the appearance of tooltip

The fill and border properties are used to customize the background color and border of the tooltip respectively. The textStyle property in the tooltip is used to customize the font of the tooltip text.

import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Legend3D, DataLabel3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { country: "USA", gold: 50, silver: 70, bronze: 45 },
        { country: "China", gold: 40, silver: 60, bronze: 55 },
        { country: "Japan", gold: 70, silver: 60, bronze: 50 },
        { country: "Australia", gold: 60, silver: 56, bronze: 40 },
        { country: "France", gold: 50, silver: 45, bronze: 35 },
        { country: "Germany", gold: 40, silver: 30, bronze: 22 },
        { country: "Italy", gold: 40, silver: 35, bronze: 37 },
        { country: "Sweden", gold: 30, silver: 25, bronze: 27 }
    ];
    const tooltip = { enable: true,
        format: '${series.name} ${point.x} : ${point.y}',
        fill: '#7bb4eb',
        border: {
            width: 2,
            color: 'grey'
        } 
    };
    return <Chart3DComponent id='charts' primaryXAxis=
        tooltip={tooltip}
            wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, Category3D, Legend3D, Tooltip3D, DataLabel3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='country' yName='gold' name="Country" type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Legend3D, DataLabel3D, Tooltip3D, ColumnSeries3D, Highlight3D } from '@syncfusion/ej2-react-charts';
import * as React from "react";
import * as ReactDOM from "react-dom";

function App() {
    const data = [
        { country: "USA", gold: 50, silver: 70, bronze: 45 },
        { country: "China", gold: 40, silver: 60, bronze: 55 },
        { country: "Japan", gold: 70, silver: 60, bronze: 50 },
        { country: "Australia", gold: 60, silver: 56, bronze: 40 },
        { country: "France", gold: 50, silver: 45, bronze: 35 },
        { country: "Germany", gold: 40, silver: 30, bronze: 22 },
        { country: "Italy", gold: 40, silver: 35, bronze: 37 },
        { country: "Sweden", gold: 30, silver: 25, bronze: 27 }
    ];
    const tooltip = { enable: true,
        format: '${series.name} ${point.x} : ${point.y}',
        fill: '#7bb4eb',
        border: {
            width: 2,
            color: 'grey'
        } 
    };
    return <Chart3DComponent id='charts' primaryXAxis=
        tooltip={tooltip}
            wallColor='transparent'
            enableRotation={true} rotation={7} tilt={10} depth={100}>
            <Inject services={[ColumnSeries3D, Category3D, Legend3D, Tooltip3D, DataLabel3D, Highlight3D]} />
            <Chart3DSeriesCollectionDirective >
                <Chart3DSeriesDirective dataSource={data} xName='country' yName='gold' name="Country" type='Column'>
                </Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>;
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));

Access data values in the tooltipRender event

The original data associated with the hovered point can be accessed through the data.rawData property of the tooltipRender event argument. This allows additional values that are not directly mapped to the chart to be used when customizing the tooltip content. The rawData property contains a copy of the original data source object. Therefore, modifying this object within the event does not update the chart’s underlying data source.

In the following example, the region and growth fields are retrieved from args.data.rawData and displayed in the tooltip.

import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Tooltip3D, ColumnSeries3D } from '@syncfusion/ej2-react-charts';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

function App() {
    const chartData = [
        { x: 'USA', y: 35, region: 'North America', growth: 12.5 },
        { x: 'UK', y: 22, region: 'Europe', growth: 9.8 },
        { x: 'India', y: 28, region: 'Asia', growth: 15.2 },
        { x: 'Germany', y: 15, region: 'Europe', growth: 7.6 }
    ];

    const primaryXAxis = { valueType: 'Category', title: 'Country' };
    const primaryYAxis = { title: 'Sales' };
    const tooltip = { enable: true };

    const tooltipRender = (args) => {
        const rawData = args.data.rawData;

        if (rawData) {
            args.text = 'Sales: <b>' + rawData.y + '</b><br/>' +
                'Region: <b>' + rawData.region + '</b><br/>' +
                'Growth: <b>' + rawData.growth + '%</b>';
        }
    };

    return (
        <Chart3DComponent id="chart3d" primaryXAxis={primaryXAxis} primaryYAxis={primaryYAxis} tooltip={tooltip} tooltipRender={tooltipRender} wallColor="transparent" enableRotation={true} rotation={7} tilt={10} depth={100} title="Sales by Country">
            <Inject services={[ColumnSeries3D, Category3D, Tooltip3D]} />
            <Chart3DSeriesCollectionDirective>
                <Chart3DSeriesDirective dataSource={chartData} xName="x" yName="y" name="Sales" type="Column"></Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>
    );
}

export default App;
ReactDOM.render(<App />, document.getElementById('charts'));
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, Category3D, Inject, Tooltip3D, ColumnSeries3D } from '@syncfusion/ej2-react-charts';
import type { Chart3DTooltipRenderEventArgs } from '@syncfusion/ej2-charts';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

interface SalesData {
    x: string;
    y: number;
    region: string;
    growth: number;
}

function App() {
    const chartData: SalesData[] = [
        { x: 'USA', y: 35, region: 'North America', growth: 12.5 },
        { x: 'UK', y: 22, region: 'Europe', growth: 9.8 },
        { x: 'India', y: 28, region: 'Asia', growth: 15.2 },
        { x: 'Germany', y: 15, region: 'Europe', growth: 7.6 }
    ];

    const primaryXAxis: Object = { valueType: 'Category', title: 'Country' };
    const primaryYAxis: Object = { title: 'Sales' };
    const tooltip: Object = { enable: true };

    const tooltipRender = (args: Chart3DTooltipRenderEventArgs): void => {
        const rawData: SalesData = args.data.rawData as SalesData;

        if (rawData) {
            args.text = 'Sales: <b>' + rawData.y + '</b><br/>' +
                'Region: <b>' + rawData.region + '</b><br/>' +
                'Growth: <b>' + rawData.growth + '%</b>';
        }
    };

    return (
        <Chart3DComponent id="chart3d" primaryXAxis={primaryXAxis} primaryYAxis={primaryYAxis} tooltip={tooltip} tooltipRender={tooltipRender} wallColor="transparent" enableRotation={true} rotation={7} tilt={10} depth={100} title="Sales by Country">
            <Inject services={[ColumnSeries3D, Category3D, Tooltip3D]} />
            <Chart3DSeriesCollectionDirective>
                <Chart3DSeriesDirective dataSource={chartData} xName="x" yName="y" name="Sales" type="Column"></Chart3DSeriesDirective>
            </Chart3DSeriesCollectionDirective>
        </Chart3DComponent>
    );
}

export default App;
ReactDOM.render(<App />, document.getElementById('charts'));