Overview
The React Pyramid Chart is a hierarchical structure that has data in the form of triangles divided into sections, and each section with a related dataset.
Data label
Data labels display information about data points. Templates support custom label content using HTML elements such as images, divs, and spans. Labels can also be rotated to a specified angle.
Exploding slices
Data points can be exploded on rendering and on mouse click.
Grouped points
Points can be grouped based on specific conditions. Grouped slices can be expanded into individual points through slice interaction.
Customization
Customize the look and feel of the Pyramid Chart using built-in APIs.
React Pyramid Chart code example
Get started with the React Pyramid Chart using the a few lines of HTML and JavaScript code, as demonstrated below. Also explore demo to learn how to render and configure the component.
import { AccumulationChartComponent, AccumulationSeriesCollectionDirective, AccumulationSeriesDirective, Inject, PyramidSeries}
from'@syncfusion/ej2-react-charts';
import * as React from 'react';
class App extends React.Component<{}, {}> {
public data1: any[]= [
{ x: 'United States', y: 45, text: 'USA', fill: '#00226C' },
{ x: 'Australia', y: 53, text: 'AUS: 14%', fill: '#0450C2' },
{ x: 'China', y: 56, text: 'CHN', fill: '#0073DC' },
{ x: 'India', y: 61, text: 'IND', fill: '#0D98FF' },
{ x: 'Japan', y: 40, text: 'JPN', fill: '#9CD9FF' },
{ x: 'United Kingdom', y: 20, text: 'UK', fill: '#0450C2' }
];
public render() {
return <AccumulationChartComponent id='charts'>
<Inject services={[PyramidSeries]} />
<AccumulationSeriesCollectionDirective>
<AccumulationSeriesDirective dataSource={this.data1} xName='x' yName='y' type='Pyramid'/>
</AccumulationSeriesCollectionDirective>
</AccumulationChartComponent>
}
};
ReactDOM.render(
<App />,
document.getElementById('charts') as HTMLElement
);<!DOCTYPE html>
<html>
<body>
<div id="charts"></div>
</body>
</html>Learning resources
Explore all Syncfusion React components
Explore over 140+ React UI components featuring established, and production-ready controls built for modern web app development.
- SMART COMPONENTSDATA VISUALIZATIONDROPDOWNSFILE VIEWERS & EDITORSBUTTONSINTERACTIVE CHATINPUTSNAVIGATIONNOTIFICATIONS

