Tooltip in EJ2 React Diagram component
6 Dec 202424 minutes to read
In a Graphical User Interface (GUI), a tooltip is a message that appears when the mouse hovers over an element. The diagram control provides tooltip support while dragging, resizing, rotating a node, and when the mouse hovers over any diagram element.
Default tooltip
By default, the diagram displays a tooltip showing size, position, and angle information while dragging, resizing, or rotating a node. The following images illustrate how the diagram displays node information during these interactions.
Drag | Resize | Rotate |
---|---|---|
Disable default tooltip
The default tooltip that appears while interacting with nodes can be disabled by removing the tooltip constraints from the selectorConstraints
of the selectedItems
property of the diagram.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, SelectorConstraints } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Default tooltip disabled',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white',
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'}
selectedItems=
//Defines nodes
nodes={node}
//Defines mouse over tooltip
tooltip=<h1 id="tooltip-in-react-3d-circular-chart-component">Tooltip in React 3D Circular Chart component</h1>
<p>The 3D Circular Chart will display details about the points through a tooltip, when the mouse is moved over a specific point. By default, the tooltip is not visible. It can be enabled by using the <code>enable</code> property in <code>tooltip</code> to <strong>true</strong>.</p>
<div class="tabs" id="code-snippet-1">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#1ihkdflxbb6r2qw3pxll6b1ewmcy3zde-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#vdh8pkx2j4th35rpmw0264j7tl4bcr0z-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="1ihkdflxbb6r2qw3pxll6b1ewmcy3zde-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="vdh8pkx2j4th35rpmw0264j7tl4bcr0z-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span>: <span class="kt">true</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-fupfe3yt9y0foo719ix9evplzhdmthyz" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs1',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-fupfe3yt9y0foo719ix9evplzhdmthyz" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs1');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-fupfe3yt9y0foo719ix9evplzhdmthyz"></div>
<blockquote>
<p>To use data label feature, we need to inject <code>CircularChartTooltip3D</code> module into the services.</p>
</blockquote>
<h2 id="header">Header</h2>
<p>You can specify a header for the tooltip by using the <code>header</code> property in <code>tooltip</code>.</p>
<div class="tabs" id="code-snippet-2">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#sf8qj4tzamq3iya48apknqgfmx7kpw0h-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#8wcgia8cabp51klf60rz7erqc36b5ndm-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="sf8qj4tzamq3iya48apknqgfmx7kpw0h-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">header</span><span class="o">:</span> <span class="s1">'Browser'</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="8wcgia8cabp51klf60rz7erqc36b5ndm-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">header</span><span class="o">:</span> <span class="s1">'Browser'</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-jvc6b3x2891lm7o59hni24f93xtlidg5" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs2',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-jvc6b3x2891lm7o59hni24f93xtlidg5" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs2');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-jvc6b3x2891lm7o59hni24f93xtlidg5"></div>
<h2 id="format">Format</h2>
<p>By default, the tooltip shows information about the x and y values in points. Additionally, more information can be displayed in the tooltip by using the <code>format</code> property. For example, the format <code>${series.name} : ${point.x}</code> shows the series name and the point’s x value.</p>
<div class="tabs" id="code-snippet-3">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#7lpor5c03dotrvlr1c9kcvbwrfs7wevh-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#4kdjb2q23f35m7j6n5zxr2xxxyja88qa-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="7lpor5c03dotrvlr1c9kcvbwrfs7wevh-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">format</span><span class="o">:</span> <span class="s1">'${point.x}'</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="4kdjb2q23f35m7j6n5zxr2xxxyja88qa-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">format</span><span class="o">:</span> <span class="s1">'${point.x}'</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-34zvf1tiypzfya1797kqng8rdhso44mn" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs3',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-34zvf1tiypzfya1797kqng8rdhso44mn" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs3');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-34zvf1tiypzfya1797kqng8rdhso44mn"></div>
<h2 id="tooltip-template">Tooltip template</h2>
<p>Any HTML elements can be displayed in the tooltip by using the <code>template</code> property in the tooltip.</p>
<div class="tabs" id="code-snippet-4">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#zx1f8jq73esgz1xuv9kau939a60fx9g8-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#n68ziif2fmjapz8wkoqm7utr5nlc5a0a-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="zx1f8jq73esgz1xuv9kau939a60fx9g8-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">template</span><span class="o">:</span> <span class="s1">'<div> ${x} : ${y} <div>'</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="n68ziif2fmjapz8wkoqm7utr5nlc5a0a-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">template</span><span class="o">:</span> <span class="s1">'<div> ${x} : ${y} <div>'</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-gmdkt4yj7tglwp6vk8pv4ptwrz1edo8i" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs4',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-gmdkt4yj7tglwp6vk8pv4ptwrz1edo8i" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs4');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-gmdkt4yj7tglwp6vk8pv4ptwrz1edo8i"></div>
<h2 id="fixed-tooltip">Fixed tooltip</h2>
<p>By default, the tooltip tracks the mouse movement, but it can be set to a fixed position using the <code>location</code> property in <code>tooltip</code>.</p>
<div class="tabs" id="code-snippet-5">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#nlym3hqg3hxjhrkvch1ji7azy3pztlx6-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#dkyxybqjh7gweusuetmxkft3rn2ryrwo-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="nlym3hqg3hxjhrkvch1ji7azy3pztlx6-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">location</span><span class="o">:</span> <span class="p">{</span><span class="nx">x</span><span class="o">:</span> <span class="mf">200</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">90</span><span class="p">}</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="dkyxybqjh7gweusuetmxkft3rn2ryrwo-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">location</span><span class="o">:</span> <span class="p">{</span><span class="nx">x</span>: <span class="kt">200</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">90</span><span class="p">}</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-27uu05mla9dbegqawnwd0xjn37c9z7th" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs5',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-27uu05mla9dbegqawnwd0xjn37c9z7th" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs5');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-27uu05mla9dbegqawnwd0xjn37c9z7th"></div>
<h2 id="customization">Customization</h2>
<p>The <code>fill</code> and <code>border</code> properties are used to customize the background color and border of the tooltip, respectively. The <code>textStyle</code> property in the tooltip is used to customize the font of the tooltip text. Additionally, the <code>highlightColor</code> property can be used to change the color of the data point when hovering.</p>
<div class="tabs" id="code-snippet-6">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#y1dtxozwx6lleonsw4wp100qns4z05hr-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#fb9190qfnsde1eegzrlq5ysqvd0tgwsx-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="y1dtxozwx6lleonsw4wp100qns4z05hr-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">fill</span><span class="o">:</span> <span class="s1">'red'</span><span class="p">,</span> <span class="nx">border</span><span class="o">:</span><span class="p">{</span><span class="nx">width</span><span class="o">:</span> <span class="mf">1.45</span><span class="p">,</span> <span class="nx">color</span> <span class="o">:</span> <span class="s1">'white'</span><span class="p">}</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="fb9190qfnsde1eegzrlq5ysqvd0tgwsx-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">fill</span><span class="o">:</span> <span class="s1">'red'</span><span class="p">,</span> <span class="nx">border</span><span class="o">:</span><span class="p">{</span><span class="nx">width</span>: <span class="kt">1.45</span><span class="p">,</span> <span class="nx">color</span> <span class="o">:</span> <span class="s1">'white'</span><span class="p">}</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-xejhd72p57rk7kdd5no2pao18kfy1xvq" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs6',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-xejhd72p57rk7kdd5no2pao18kfy1xvq" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs6');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-xejhd72p57rk7kdd5no2pao18kfy1xvq"></div>
<h2 id="customization-of-individual-tooltip">Customization of individual tooltip</h2>
<p>Using the <code>tooltipRender</code> event, you can customize tooltip values for a particular point.</p>
<div class="tabs" id="code-snippet-7">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#k1a9gh5eh4o5lek54x041x2zpz4h8xda-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#g4ddxbycck4wdfndjtkvl01jc5xtma1j-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="k1a9gh5eh4o5lek54x041x2zpz4h8xda-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="kd">const</span> <span class="nx">textRender</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">args</span><span class="p">.</span><span class="nx">point</span><span class="p">.</span><span class="nx">index</span> <span class="o">===</span> <span class="mf">0</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">args</span><span class="p">.</span><span class="nx">text</span> <span class="o">=</span> <span class="s1">'Custom Tooltip'</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltipRender</span><span class="o">=</span><span class="p">{</span><span class="nx">textRender</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span><span class="o">:</span><span class="kc">true</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="g4ddxbycck4wdfndjtkvl01jc5xtma1j-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="kd">const</span> <span class="nx">textRender</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">args</span><span class="p">.</span><span class="nx">point</span><span class="p">.</span><span class="nx">index</span> <span class="o">===</span> <span class="mf">0</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">args</span><span class="p">.</span><span class="nx">text</span> <span class="o">=</span> <span class="s1">'Custom Tooltip'</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltipRender</span><span class="o">=</span><span class="p">{</span><span class="nx">textRender</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-rn94ca5ozdjf5n1hz2xb4hz14mk2xhgz" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs7',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-rn94ca5ozdjf5n1hz2xb4hz14mk2xhgz" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs7');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-rn94ca5ozdjf5n1hz2xb4hz14mk2xhgz"></div>
/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, SelectorConstraints,NodeModel } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node:NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Default tooltip disabled',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white',
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'}
selectedItems=
//Defines nodes
nodes={node}
//Defines mouse over tooltip
tooltip=<h1 id="tooltip-in-react-3d-circular-chart-component">Tooltip in React 3D Circular Chart component</h1>
<p>The 3D Circular Chart will display details about the points through a tooltip, when the mouse is moved over a specific point. By default, the tooltip is not visible. It can be enabled by using the <code>enable</code> property in <code>tooltip</code> to <strong>true</strong>.</p>
<div class="tabs" id="code-snippet-1">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#1ihkdflxbb6r2qw3pxll6b1ewmcy3zde-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#vdh8pkx2j4th35rpmw0264j7tl4bcr0z-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="1ihkdflxbb6r2qw3pxll6b1ewmcy3zde-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="vdh8pkx2j4th35rpmw0264j7tl4bcr0z-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span>: <span class="kt">true</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-fupfe3yt9y0foo719ix9evplzhdmthyz" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs1',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-fupfe3yt9y0foo719ix9evplzhdmthyz" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs1');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-fupfe3yt9y0foo719ix9evplzhdmthyz"></div>
<blockquote>
<p>To use data label feature, we need to inject <code>CircularChartTooltip3D</code> module into the services.</p>
</blockquote>
<h2 id="header">Header</h2>
<p>You can specify a header for the tooltip by using the <code>header</code> property in <code>tooltip</code>.</p>
<div class="tabs" id="code-snippet-2">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#sf8qj4tzamq3iya48apknqgfmx7kpw0h-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#8wcgia8cabp51klf60rz7erqc36b5ndm-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="sf8qj4tzamq3iya48apknqgfmx7kpw0h-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">header</span><span class="o">:</span> <span class="s1">'Browser'</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="8wcgia8cabp51klf60rz7erqc36b5ndm-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">header</span><span class="o">:</span> <span class="s1">'Browser'</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-jvc6b3x2891lm7o59hni24f93xtlidg5" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs2',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-jvc6b3x2891lm7o59hni24f93xtlidg5" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs2');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-jvc6b3x2891lm7o59hni24f93xtlidg5"></div>
<h2 id="format">Format</h2>
<p>By default, the tooltip shows information about the x and y values in points. Additionally, more information can be displayed in the tooltip by using the <code>format</code> property. For example, the format <code>${series.name} : ${point.x}</code> shows the series name and the point’s x value.</p>
<div class="tabs" id="code-snippet-3">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#7lpor5c03dotrvlr1c9kcvbwrfs7wevh-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#4kdjb2q23f35m7j6n5zxr2xxxyja88qa-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="7lpor5c03dotrvlr1c9kcvbwrfs7wevh-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">format</span><span class="o">:</span> <span class="s1">'${point.x}'</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="4kdjb2q23f35m7j6n5zxr2xxxyja88qa-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">format</span><span class="o">:</span> <span class="s1">'${point.x}'</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-34zvf1tiypzfya1797kqng8rdhso44mn" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs3',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-34zvf1tiypzfya1797kqng8rdhso44mn" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs3');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-34zvf1tiypzfya1797kqng8rdhso44mn"></div>
<h2 id="tooltip-template">Tooltip template</h2>
<p>Any HTML elements can be displayed in the tooltip by using the <code>template</code> property in the tooltip.</p>
<div class="tabs" id="code-snippet-4">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#zx1f8jq73esgz1xuv9kau939a60fx9g8-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#n68ziif2fmjapz8wkoqm7utr5nlc5a0a-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="zx1f8jq73esgz1xuv9kau939a60fx9g8-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">template</span><span class="o">:</span> <span class="s1">'<div> ${x} : ${y} <div>'</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="n68ziif2fmjapz8wkoqm7utr5nlc5a0a-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">template</span><span class="o">:</span> <span class="s1">'<div> ${x} : ${y} <div>'</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-gmdkt4yj7tglwp6vk8pv4ptwrz1edo8i" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs4',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-gmdkt4yj7tglwp6vk8pv4ptwrz1edo8i" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs4');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-gmdkt4yj7tglwp6vk8pv4ptwrz1edo8i"></div>
<h2 id="fixed-tooltip">Fixed tooltip</h2>
<p>By default, the tooltip tracks the mouse movement, but it can be set to a fixed position using the <code>location</code> property in <code>tooltip</code>.</p>
<div class="tabs" id="code-snippet-5">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#nlym3hqg3hxjhrkvch1ji7azy3pztlx6-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#dkyxybqjh7gweusuetmxkft3rn2ryrwo-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="nlym3hqg3hxjhrkvch1ji7azy3pztlx6-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">location</span><span class="o">:</span> <span class="p">{</span><span class="nx">x</span><span class="o">:</span> <span class="mf">200</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">90</span><span class="p">}</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="dkyxybqjh7gweusuetmxkft3rn2ryrwo-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">location</span><span class="o">:</span> <span class="p">{</span><span class="nx">x</span>: <span class="kt">200</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">90</span><span class="p">}</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-27uu05mla9dbegqawnwd0xjn37c9z7th" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs5',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-27uu05mla9dbegqawnwd0xjn37c9z7th" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs5');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-27uu05mla9dbegqawnwd0xjn37c9z7th"></div>
<h2 id="customization">Customization</h2>
<p>The <code>fill</code> and <code>border</code> properties are used to customize the background color and border of the tooltip, respectively. The <code>textStyle</code> property in the tooltip is used to customize the font of the tooltip text. Additionally, the <code>highlightColor</code> property can be used to change the color of the data point when hovering.</p>
<div class="tabs" id="code-snippet-6">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#y1dtxozwx6lleonsw4wp100qns4z05hr-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#fb9190qfnsde1eegzrlq5ysqvd0tgwsx-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="y1dtxozwx6lleonsw4wp100qns4z05hr-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">fill</span><span class="o">:</span> <span class="s1">'red'</span><span class="p">,</span> <span class="nx">border</span><span class="o">:</span><span class="p">{</span><span class="nx">width</span><span class="o">:</span> <span class="mf">1.45</span><span class="p">,</span> <span class="nx">color</span> <span class="o">:</span> <span class="s1">'white'</span><span class="p">}</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="fb9190qfnsde1eegzrlq5ysqvd0tgwsx-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span><span class="p">,</span> <span class="nx">fill</span><span class="o">:</span> <span class="s1">'red'</span><span class="p">,</span> <span class="nx">border</span><span class="o">:</span><span class="p">{</span><span class="nx">width</span>: <span class="kt">1.45</span><span class="p">,</span> <span class="nx">color</span> <span class="o">:</span> <span class="s1">'white'</span><span class="p">}</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-xejhd72p57rk7kdd5no2pao18kfy1xvq" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs6',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-xejhd72p57rk7kdd5no2pao18kfy1xvq" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs6');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-xejhd72p57rk7kdd5no2pao18kfy1xvq"></div>
<h2 id="customization-of-individual-tooltip">Customization of individual tooltip</h2>
<p>Using the <code>tooltipRender</code> event, you can customize tooltip values for a particular point.</p>
<div class="tabs" id="code-snippet-7">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class=""><a data-target="#k1a9gh5eh4o5lek54x041x2zpz4h8xda-js" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="js">index.jsx</a></li>
<li role="presentation" class=""><a data-target="#g4ddxbycck4wdfndjtkvl01jc5xtma1j-ts" aria-controls="home" role="tab" data-toggle="tab" data-original-lang="ts">index.tsx</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="k1a9gh5eh4o5lek54x041x2zpz4h8xda-js" data-original-lang="js">
<div class="highlight"><pre><code class="prettyprint language-js" data-lang="js"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span><span class="o">:</span> <span class="mf">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="kd">const</span> <span class="nx">textRender</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">args</span><span class="p">.</span><span class="nx">point</span><span class="p">.</span><span class="nx">index</span> <span class="o">===</span> <span class="mf">0</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">args</span><span class="p">.</span><span class="nx">text</span> <span class="o">=</span> <span class="s1">'Custom Tooltip'</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltipRender</span><span class="o">=</span><span class="p">{</span><span class="nx">textRender</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span><span class="nx">enable</span><span class="o">:</span><span class="kc">true</span><span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
<div role="tabpanel" class="tab-pane" id="g4ddxbycck4wdfndjtkvl01jc5xtma1j-ts" data-original-lang="ts">
<div class="highlight"><pre><code class="prettyprint language-ts" data-lang="ts"><span></span><span class="k">import</span> <span class="p">{</span>
<span class="nx">CircularChart3DComponent</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="p">,</span>
<span class="nx">CircularChart3DSeriesDirective</span><span class="p">,</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="nx">Inject</span><span class="p">,</span>
<span class="p">}</span> <span class="kr">from</span> <span class="s1">'@syncfusion/ej2-react-charts'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">React</span> <span class="kr">from</span> <span class="s1">'react'</span><span class="p">;</span>
<span class="k">import</span> <span class="o">*</span> <span class="kr">as</span> <span class="nx">ReactDOM</span> <span class="kr">from</span> <span class="s1">'react-dom'</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">App</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">circularData</span>: <span class="kt">any</span><span class="p">[]</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Chrome'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">62.92</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Internet Explorer'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">6.12</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Opera'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">3.15</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Edge'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">5.5</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Safari'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">19.97</span> <span class="p">},</span>
<span class="p">{</span> <span class="nx">x</span><span class="o">:</span> <span class="s1">'Others'</span><span class="p">,</span> <span class="nx">y</span>: <span class="kt">2.34</span> <span class="p">},</span>
<span class="p">];</span>
<span class="kd">const</span> <span class="nx">textRender</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">args</span><span class="p">.</span><span class="nx">point</span><span class="p">.</span><span class="nx">index</span> <span class="o">===</span> <span class="mf">0</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">args</span><span class="p">.</span><span class="nx">text</span> <span class="o">=</span> <span class="s1">'Custom Tooltip'</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="k">return</span> <span class="p">(</span>
<span class="o"><</span><span class="nx">CircularChart3DComponent</span>
<span class="nx">id</span><span class="o">=</span><span class="s2">"charts"</span>
<span class="nx">title</span><span class="o">=</span><span class="s2">"Browser Market Shares in November 2023"</span>
<span class="nx">tilt</span><span class="o">=</span><span class="p">{</span><span class="o">-</span><span class="mf">45</span><span class="p">}</span>
<span class="nx">tooltipRender</span><span class="o">=</span><span class="p">{</span><span class="nx">textRender</span><span class="p">}</span>
<span class="nx">tooltip</span><span class="o">=</span><span class="p">{{</span> <span class="nx">enable</span>: <span class="kt">true</span> <span class="p">}}</span>
<span class="o">></span>
<span class="o"><</span><span class="nx">Inject</span>
<span class="nx">services</span><span class="o">=</span><span class="p">{[</span>
<span class="nx">PieSeries3D</span><span class="p">,</span>
<span class="nx">CircularChartDataLabel3D</span><span class="p">,</span>
<span class="nx">CircularChartTooltip3D</span><span class="p">,</span>
<span class="p">]}</span>
<span class="o">/></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesCollectionDirective</span><span class="o">></span>
<span class="o"><</span><span class="nx">CircularChart3DSeriesDirective</span>
<span class="nx">dataSource</span><span class="o">=</span><span class="p">{</span><span class="nx">circularData</span><span class="p">}</span>
<span class="nx">xName</span><span class="o">=</span><span class="s2">"x"</span>
<span class="nx">yName</span><span class="o">=</span><span class="s2">"y"</span>
<span class="nx">dataLabel</span><span class="o">=</span><span class="p">{{</span>
<span class="nx">visible</span>: <span class="kt">true</span><span class="p">,</span>
<span class="p">}}</span>
<span class="o">><</span><span class="err">/CircularChart3DSeriesDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DSeriesCollectionDirective></span>
<span class="o"><</span><span class="err">/CircularChart3DComponent></span>
<span class="p">);</span>
<span class="p">}</span>
<span class="k">export</span> <span class="k">default</span> <span class="nx">App</span><span class="p">;</span>
<span class="nx">ReactDOM</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="o"><</span><span class="nx">App</span> <span class="o">/></span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'charts'</span><span class="p">));</span></code></pre></div>
</div>
</div>
</div>
<p><button class="preview-sample-button" id="PreviewSampleButton-rn94ca5ozdjf5n1hz2xb4hz14mk2xhgz" onclick="LoadPreviewSample('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs7',this.id);">Preview Sample</button><button class="stackblitz-button" id="StackBlitzButton-rn94ca5ozdjf5n1hz2xb4hz14mk2xhgz" onclick="OpenSampleInStackBlitz('https://ej2.syncfusion.com/react/documentation/code-snippet/circular-chart/tooltip/tooltip-cs7');"><img class="stackblitz-icon" src="https://cdn.syncfusion.com/documentation/images/StackBlitz-icon.png"><span class="stackblitz-text">Open in Stackblitz</span></button></p>
<div id="PreviewSampleHolder-rn94ca5ozdjf5n1hz2xb4hz14mk2xhgz"></div>
/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Tooltip for a specific node/connector
The tooltip can be customized for each node and connector. Remove the InheritTooltip option from the constraints
of that node/connector. The following code example illustrates how to customize the tooltip for individual elements.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints,ConnectorConstraints } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
//Sets the content of the Tooltip
content: 'Node1',
//Sets the position of the Tooltip
position: 'BottomRight',
//Sets the tooltip position relative to the node
relativeMode: 'Object'
},
}];
let connector = [{
id: 'connector1',
sourcePoint: { x: 300, y: 100 },
targetPoint: { x: 400, y: 250 },
tooltip: { content: 'connector' },
constraints: ConnectorConstraints.Default | ConnectorConstraints.Tooltip,
}]
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node} connectors={connector}
/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints,ConnectorConstraints,NodeModel, } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node:NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
//Sets the content of the Tooltip
content: 'Node1',
//Sets the position of the Tooltip
position: 'BottomRight',
//Sets the tooltip position relative to the node
relativeMode: 'Object'
},
}];
let connector = [{
id: 'connector1',
sourcePoint: { x: 300, y: 100 },
targetPoint: { x: 400, y: 250 },
tooltip: { content: 'connector' },
constraints: ConnectorConstraints.Default | ConnectorConstraints.Tooltip,
}]
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node} connectors={connector}
/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Inherit diagram tooltip
The diagram supports inheriting the diagram tooltip when the mouse hovers over any node or connector. To show a tooltip on mouse over, set the diagram’s tooltip
property with the tooltip content
and position
. Ensure that the nodes and connectors have their constraints set to InheritTooltip, as shown in the following example.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints,ConnectorConstraints } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.InheritTooltip,
//Defines mouse over tooltip for a node
tooltip: {
//Sets the content of the Tooltip
content: 'Node1',
},
}];
let connector = [{
id: 'connector1',
sourcePoint: { x: 300, y: 100 },
targetPoint: { x: 400, y: 250 },
tooltip: { content: 'connector' },
constraints: ConnectorConstraints.Default | ConnectorConstraints.InheritTooltip,
}]
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node} connectors={connector}
//Defines mouse over tooltip for a node
tooltip={{
content: 'DiagramTooltip',
position: 'BottomRight',
}}
/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints,ConnectorConstraints,NodeModel, } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node:NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.InheritTooltip,
//Defines mouse over tooltip for a node
tooltip: {
//Sets the content of the Tooltip
content: 'Node1'
},
}];
let connector = [{
id: 'connector1',
sourcePoint: { x: 300, y: 100 },
targetPoint: { x: 400, y: 250 },
tooltip: { content: 'connector' },
constraints: ConnectorConstraints.Default | ConnectorConstraints.InheritTooltip,
}]
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node} connectors={connector}
//Defines mouse over tooltip for a node
tooltip={{
content: 'DiagramTooltip',
position: 'BottomRight',
}}
/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Disable tooltip at runtime
The tooltip on mouse over can be disabled by setting the diagram’s tooltip
property to null
. The following code example illustrates how to disable the mouse over tooltip at runtime.
//Initializes the diagram component
<DiagramComponent id="container" width={'650px'} height={'350px'}
//Defines nodes
nodes={node} connectors={connector}
//Disables mouse over tooltip at runtime
tooltip = {null}
/>
Tooltip for Ports
The tooltip feature has been implemented to support Ports, providing the ability to display information or descriptions when the mouse hovers over them.
To display tooltips on mouseover, set the desired tooltip content
by utilizing the tooltip
property.
Tooltips for Ports can be enabled or disabled using the PortConstraints
Tooltip property.
let ports: [{
offset: {x: 1,y: 0.5},
tooltip: {content: 'Port Tootip'},
//enable Port Tooltip Constraints
constraints: PortConstraints.Default | PortConstraints.ToolTip,
//disable Port Tooltip Constraints
constraints: PortConstraints.Default ~& PortConstraints.ToolTip
}]
Dynamic modification of tooltip content is supported, allowing you to change the displayed tooltip content during runtime.
{
//change tooltip content at run time
diagram.nodes[0].ports[0].tooltip.content = 'New Tooltip Content';
diagram.databind;
}
Here, the code provided below demonstrates the port tooltip Interaction.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent,PortConstraints,PortVisibility } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node = [{
id: "node1",
width: 100,
height: 100,
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
ports:[{
offset: {
x: 0.5,
y: 0
},
visibility: PortVisibility.Visible,
//Defines mouse over tooltip for a node
tooltip: {
//Sets the content of the Tooltip
content: 'Port Tooltip',
},
constraints: PortConstraints.Default | PortConstraints.ToolTip
}]
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent,PortConstraints,PortVisibility,NodeModel } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node:NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
ports:[{
offset: {
x: 0.5,
y: 0
},
visibility: PortVisibility.Visible,
//Defines mouse over tooltip for a node
tooltip: {
//Sets the content of the Tooltip
content: 'Port Tooltip',
},
constraints: PortConstraints.Default | PortConstraints.ToolTip
}]
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
The following image illustrates how the diagram displays tooltips during an interaction with ports:
Tooltip template content
The tooltip template content allows you to customize the tooltip by using HTML templates. This means you can define the structure and style of the tooltip using HTML, providing greater flexibility and control over its appearance. By leveraging HTML templates, you can include rich content such as formatted text, images, and other HTML elements within the tooltip, enhancing the user experience with more informative and visually appealing tooltips.
The following code example illustrates how to add formatted HTML content to the tooltip.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
//Sets the content of the Tooltip
content: getContent(),
}
}];
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
function getContent() {
let tooltipContent = document.createElement('div');
tooltipContent.innerHTML = '<div style="background-color: #f4f4f4; color: black; border-width:1px;border-style: solid;border-color: #d3d3d3; border-radius: 8px;white-space: nowrap;"> <span style="margin: 10px;"> Tooltip !!! </span> </div>';
return tooltipContent;
}
import * as React from "react";
import * as ReactDOM from "react-dom";
import {
Diagram,
NodeModel,
DiagramComponent,
DiagramConstraints,
NodeConstraints
} from "@syncfusion/ej2-react-diagrams";
import {
NodeAnimationSettings
} from '@syncfusion/ej2-navigations';
// A node is created and stored in nodes array.
let node: NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
//Sets the content of the Tooltip
content: getContent(),
}
}];
function App() {
return (
<DiagramComponent
id="container"
width={'650px'}
height={'350px'}
constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}
/>
);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
function getContent(): HTMLElement {
let tooltipContent: HTMLElement = document.createElement('div');
tooltipContent.innerHTML = '<div style="background-color: #f4f4f4; color: black; border-width:1px;border-style: solid;border-color: #d3d3d3; border-radius: 8px;white-space: nowrap;"> <span style="margin: 10px;"> Tooltip !!! </span> </div>';
return tooltipContent;
}
Tooltip alignments
Tooltip relative to object
The diagram supports displaying a tooltip around the node or connector that is hovered over by the mouse. The tooltip’s alignment can be adjusted using the position
property. The relativeMode
property specifies whether the tooltip should be displayed around the object or at the mouse position.
The following code example illustrates how to position the tooltip around object.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
}
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
//Sets the alignment properties
position: 'BottomRight',
//Sets to show tooltip around the element
relativeMode: 'Object',
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import {
Diagram,
NodeModel,
DiagramComponent,
DiagramConstraints,
NodeConstraints
} from "@syncfusion/ej2-react-diagrams";
import {
NodeAnimationSettings
} from '@syncfusion/ej2-navigations';
// A node is created and stored in nodes array.
let node: NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
}
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
//Sets the alignment properties
position: 'BottomRight',
//Sets to show tooltip around the element
relativeMode: 'Object',
},
}];
//Initializes the Diagram component
function App() {
return (
<DiagramComponent
id="container"
width={'650px'}
height={'350px'}
constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}
/>
);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Tooltip relative to mouse position
To display the tooltip at the mouse position, set the mouse option in the relativeMode
property of the tooltip.
The following code example illustrates how to show tooltip at mouse position.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints } from "@syncfusion/ej2-react-diagrams";
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
}
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
//Sets to show tooltip at mouse position
relativeMode: 'Mouse',
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import {
Diagram,
NodeModel,
DiagramComponent,
DiagramConstraints,
NodeConstraints
} from "@syncfusion/ej2-react-diagrams";
import {
NodeAnimationSettings
} from '@syncfusion/ej2-navigations';
let node: NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
}
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
//Sets to show tooltip at mouse position
relativeMode: 'Mouse',
},
}];
//Initializes the Diagram component
function App() {
return (
<DiagramComponent
id="container"
width={'650px'}
height={'350px'}
constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}
/>
);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Tooltip animation
To animate the tooltip, you can use a range of animation effects controlled by the animation
property. This property allows you to customize the delay, duration, and various other effects according to your preferences.
Refer the following sample where we used zoomIn animation for tooltip open and zoomOut animation for tooltip close with delay and duration.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints } from "@syncfusion/ej2-react-diagrams";
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
animation: {
//Animation settings to be applied on the Tooltip, while it is being shown over the target.
open: {
//Animation effect on the Tooltip is applied during open and close actions.
effect: 'ZoomIn',
//Duration of the animation that is completed per animation cycle.
duration: 1000,
//Indicating the waiting time before animation begins.
delay: 0
},
//Animation settings to be applied on the Tooltip, when it is closed.
close: {
effect: 'ZoomOut',
duration: 500,
delay: 0
},
},
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import {
Diagram,
DiagramComponent,
NodeModel,
DiagramConstraints,
NodeConstraints
} from "@syncfusion/ej2-react-diagrams";
import {
NodeAnimationSettings
} from '@syncfusion/ej2-navigations';
let node: NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
animation: {
//Animation settings to be applied on the Tooltip, while it is being shown over the target.
open: {
//Animation effect on the Tooltip is applied during open and close actions.
effect: 'ZoomIn',
//Duration of the animation that is completed per animation cycle.
duration: 1000,
//Indicating the waiting time before animation begins.
delay: 0
},
//Animation settings to be applied on the Tooltip, when it is closed.
close: {
effect: 'ZoomOut',
duration: 500,
delay: 0
},
},
},
}];
//Initializes the Diagram component
function App() {
return (
<DiagramComponent
id="container"
width={'650px'}
height={'350px'}
constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}
/>
);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Sticky tooltip
A sticky tooltip will remain visible even after you move the mouse away from the node or connector. You can activate this feature by setting the isSticky
property of the tooltip.
The following example shows how to render sticky tooltip.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints } from "@syncfusion/ej2-react-diagrams";
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
//Activate sticky mode for tooltip
isSticky: true,
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints,NodeModel } from "@syncfusion/ej2-react-diagrams";
let node: NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
//Activate sticky mode for tooltip
isSticky: true,
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Hide tooltip pointer
The showTipPointer
property allows to control the visibility of tooltip pointer. By default, the showTipPointer
is set as true.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints } from "@syncfusion/ej2-react-diagrams";
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
content: 'Rectangle',
}],
offsetX: 250,
offsetY: 200,
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
//Hide tip pointer
showTipPointer: false,
},
},{
id: "node2",
width: 100,
height: 100,
annotations: [{
content: 'Rectangle',
}],
offsetX:100,
offsetY: 200,
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
//Hide tip pointer
showTipPointer: true,
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints,NodeModel } from "@syncfusion/ej2-react-diagrams";
let node: NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
content: 'Rectangle',
}],
offsetX: 250,
offsetY: 200,
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
//Hide tip pointer
showTipPointer: false,
},
},{
id: "node2",
width: 100,
height: 100,
annotations: [{
content: 'Rectangle',
}],
offsetX:100,
offsetY: 200,
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
//Hide tip pointer
showTipPointer: true,
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Tooltip size
By default, the size of the tooltip is calculated based on its content. If you want to customize the size, you can use the width
and height
properties of the tooltip.
The following code example shows how to set the size for the tooltip:
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints } from "@syncfusion/ej2-react-diagrams";
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content:
'Syncfusion diagram nodes, connectors look and feel can also be customized any way you want. The JavaScript Diagram control provides a rich set of properties through which you can customize connector color, thickness, dash and dot appearance, corners, and even decorators',
position: 'BottomCenter',
relativeMode: 'Object',
//Set size for tooltip
width: 300,
height: 100,
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints,NodeModel } from "@syncfusion/ej2-react-diagrams";
let node: NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content:
'Syncfusion diagram nodes, connectors look and feel can also be customized any way you want. The JavaScript Diagram control provides a rich set of properties through which you can customize connector color, thickness, dash and dot appearance, corners, and even decorators',
position: 'BottomCenter',
relativeMode: 'Object',
//Set size for tooltip
width: 300,
height: 100,
},
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Show/Hide tooltip at runtime
You can show or hide the tooltip dynamically using a button click with the showTooltip
and hideTooltip
methods of the diagram. This allows you to control the tooltip visibility programmatically rather than relying on user hover actions. In some cases, you may want to display the tooltip without requiring the user to hover over the object.
The following example demonstrates how to show or hide the tooltip at runtime:
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints } from "@syncfusion/ej2-react-diagrams";
let diagramInstance;
let node = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
//To show tooltip on button click
openOn: 'Custom',
},
}];
//Initializes the Diagram component
function App() {
const showTooltip = () => {
/**
* parameter - The object for which the tooltip will be shown.
*/
diagramInstance.showTooltip(diagramInstance.nodes[0]);
}
const hideTooltip = () => {
/**
* parameter - The object for which the tooltip should be hidden.
*/
diagramInstance.hideTooltip(diagramInstance.nodes[0]);
}
return (
<div>
<button onClick={showTooltip}>showTooltip</button>
<button onClick={hideTooltip}>hideTooltip</button>
<DiagramComponent id="container" width={'650px'}
ref={(diagram) => (diagramInstance = diagram)}
height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>
</div>
);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints, NodeConstraints,NodeModel } from "@syncfusion/ej2-react-diagrams";
let diagramInstance:DiagramComponent;
let node:NodeModel[] = [{
id: "node1",
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Rectangle',
offset: {
x: 0.5,
y: 0.5
},
style: {
color: 'white'
},
}],
offsetX: 200,
offsetY: 200,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7'
},
constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
//Defines mouse over tooltip for a node
tooltip: {
content: 'Node1',
position: 'BottomCenter',
relativeMode: 'Object',
//To show tooltip on button click
openOn: 'Custom',
},
}];
//Initializes the Diagram component
function App() {
const showTooltip = () => {
/**
* parameter - The object for which the tooltip will be shown.
*/
diagramInstance.showTooltip(diagramInstance.nodes[0]);
}
const hideTooltip = () => {
/**
* parameter - The object for which the tooltip should be hidden.
*/
diagramInstance.hideTooltip(diagramInstance.nodes[0]);
}
return (
<div>
<button onClick={showTooltip}>showTooltip</button>
<button onClick={hideTooltip}>hideTooltip</button>
<DiagramComponent id="container" width={'650px'}
ref={(diagram) => (diagramInstance = diagram)}
height={'350px'} constraints={DiagramConstraints.Default | DiagramConstraints.Tooltip}
//Defines nodes
nodes={node}/>
</div>
);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
Tooltip for Annotation
Tooltips can be added to annotations to display additional information on mouseover.
To display tooltips on mouseover, set the desired tooltip text to the tooltip
property of the annotation.
Tooltips for Annotations can be enabled or disabled by setting the AnnotationConstraints
property as Tooltip
.
import * as React from "react";
import * as ReactDOM from "react-dom";
import { DiagramComponent, DiagramConstraints,AnnotationConstraints, NodeConstraints } from "@syncfusion/ej2-react-diagrams";
// A node is created and stored in nodes array.
let node = [ {
id: 'node1',
offsetX: 150,
offsetY: 150,
width: 100,
height: 100,
style: {
fill: '#6BA5D7',
strokeColor: 'white'
},
annotations: [{
id: 'label1',
content: 'Rectangle',
tooltip: {
content: 'Rectangle',
position: 'TopRight',
relativeMode: 'Object',
},
constraints: AnnotationConstraints.Tooltip,
}],
}];
//Initializes the Diagram component
function App() {
return (<DiagramComponent id="container" width={'650px'} height={'350px'}
//Defines nodes
nodes={node}/>);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);
import * as React from "react";
import * as ReactDOM from "react-dom";
import {
Diagram,
NodeModel,
DiagramComponent,
DiagramConstraints,
AnnotationConstraints,
NodeConstraints
} from "@syncfusion/ej2-react-diagrams";
import {
NodeAnimationSettings
} from '@syncfusion/ej2-navigations';
// A node is created and stored in nodes array.
let node: NodeModel[] = [ {
id: 'node1',
offsetX: 150,
offsetY: 150,
width: 100,
height: 100,
style: {
fill: '#6BA5D7',
strokeColor: 'white'
},
annotations: [{
id: 'label1',
content: 'Rectangle',
tooltip: {
content: 'Rectangle',
position: 'TopRight',
relativeMode: 'Object',
},
constraints: AnnotationConstraints.Tooltip,
}],
}];
//Initializes the Diagram component
function App() {
return (
<DiagramComponent
id="container"
width={'650px'}
height={'350px'}
//Defines nodes
nodes={node}
/>
);
}
const root = ReactDOM.createRoot(document.getElementById('diagram'));
root.render(<App />);