Syncfusion Feedback


Overview

React Bubble Chart is like a scatter chart, but allows you to visualize data in 3 dimensions. The size of the bubble is determined based on the third parameter.


Customizing each point in bubble

Appearance of each data point in a Bubble Chart can be customized using point render event to differentiate each point based on the size.


Data label

Data labels display information about data points. Add a template to display data labels with HTML elements such as images, DIV, and spans for more informative data labels. You can rotate a data label by its given angle.


React Bubble Chart Code Example

Easily get started with React Bubble Chart using a few simple lines of HTML and JS code example as demonstrated below. Also explore our React Bubble Chart Example that shows you how to render and configure the chart.

  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <body>
  5. <div id="charts"></div>
  6. </body>
  7.  
  8. </html>
  1. import {AxisModel, BubbleSeries, ChartComponent, Inject, SeriesCollectionDirective, SeriesDirective} from'@syncfusion/ej2-react-charts';
  2. import * as React from 'react';
  3. class App extends React.Component<{}, {}> {
  4. public primaryXAxis: AxisModel = { };
  5. public data1 : any[]= [
  6. { x: 1, y: 45, text: 'USA', fill: '#00226C', size: 1.347 },
  7. { x: 2, y: 20, text: 'AUS', fill: '#0450C2', size: 1 },
  8. { x: 3, y: 56, text: 'CHN', fill: '#0073DC', size: 0.01 },
  9. { x: 4, y: 30, text: 'IND', fill: '#0D98FF', size: 0.7 },
  10. { x: 5, y: 13, text: 'JPN', fill: '#9CD9FF', size: 0.333 },
  11. { x: 6, y: 45, text: 'UK', fill: '#0450C2', size: 1 }
  12. ];
  13.  
  14. public render() {
  15. return <ChartComponent id='charts' primaryXAxis={this.primaryxAxis}>
  16. <Inject services={[BubbleSeries]} />
  17. <SeriesCollectionDirective>
  18. <SeriesDirective dataSource={this.data1} xName='x' yName='y' type='Bubble'/>
  19. </SeriesCollectionDirective>
  20. </ChartComponent>
  21. }
  22. };
  23. ReactDOM.render(
  24. <App />,
  25. document.getElementById('charts') as HTMLElement
  26. );

Learning Resources

UG

Bubble Chart User Guide

Learn the available options to customize React Bubble Chart.

API

Bubble Chart API Reference

Explore the React bubble chart APIs.

90+ REACT UI COMPONENTS

Scroll up icon
Chat with us