HelpBot Assistant

How can I help you?

Bubble Chart in React Charts

3 Feb 202624 minutes to read

Bubble

To render a bubble series in your chart, you need to follow a few steps to configure it correctly. Here’s a concise guide on how to do this:

  1. Set the series type: Define the series type as Bubble in your chart configuration. This indicates that the data should be displayed as a bubble series in the chart.

  2. Inject the BubbleSeries module: Inject BubbleSeries module into the services. This step is essential, as it ensures that the necessary functionalities for rendering the bubble series are available in your chart.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { data } from './datasource';
function App() {
    const primaryxAxis = { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 };
    const primaryyAxis = { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource={data} xName='x' yName='y' size='size' type='Bubble' name='pound'>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { AxisModel, ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries}
from'@syncfusion/ej2-react-charts';
import { data } from './datasource';

function App() {

const primaryxAxis: AxisModel= { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 }  ;
const primaryyAxis: AxisModel= { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 }  ;

  return <ChartComponent id='charts'
           primaryXAxis={ primaryxAxis }
           primaryYAxis={ primaryyAxis }
           title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource ={data}  xName='x' yName='y' size='size' type='Bubble' name='pound'>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let data = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];
export let data: Object[] = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];

Binding data with series

You can bind data to the chart using the dataSource property within the series configuration. This allows you to connect a JSON dataset or remote data to your chart. To display the data correctly, map the fields from the data to the chart series xName and yName properties.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { data } from './datasource';
function App() {
    const primaryxAxis = { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 };
    const primaryyAxis = { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource={data} xName='x' yName='y' size='size' type='Bubble' name='pound'>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { AxisModel, ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries}
from'@syncfusion/ej2-react-charts';
import { data } from './datasource';

function App() {

const primaryxAxis: AxisModel= { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 }  ;
const primaryyAxis: AxisModel= { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 }  ;

  return <ChartComponent id='charts'
           primaryXAxis={ primaryxAxis }
           primaryYAxis={ primaryyAxis }
           title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource ={data}  xName='x' yName='y' size='size' type='Bubble' name='pound'>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let data = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];
export let data: Object[] = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];

Series customization

The following properties can be used to customize the bubble series.

Fill

The fill property determines the color applied to the series.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { data } from './datasource';
function App() {
    const primaryxAxis = { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 };
    const primaryyAxis = { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource={data} xName='x' yName='y' size='size' type='Bubble' name='pound' fill='blue'>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { AxisModel, ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries}
from'@syncfusion/ej2-react-charts';
import { data } from './datasource';

function App() {
const primaryxAxis: AxisModel= { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 }  ;
const primaryyAxis: AxisModel= { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 }  ;

  return <ChartComponent id='charts'
           primaryXAxis={ primaryxAxis }
           primaryYAxis={ primaryyAxis }
           title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource ={data}  xName='x' yName='y' size='size' type='Bubble' name='pound' fill='blue'>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let data = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];
export let data: Object[] = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];

Opacity

The opacity property controls the transparency of the fill and affects how the series blends with background or overlapping series.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { data } from './datasource';
function App() {
    const primaryxAxis = { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 };
    const primaryyAxis = { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource={data} xName='x' yName='y' size='size' type='Bubble' name='pound' opacity={0.5}>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { AxisModel, ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries}
from'@syncfusion/ej2-react-charts';
import { data } from './datasource';

function App() {
const primaryxAxis: AxisModel= { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 }  ;
const primaryyAxis: AxisModel= { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 }  ;

  return <ChartComponent id='charts'
           primaryXAxis={ primaryxAxis }
           primaryYAxis={ primaryyAxis }
           title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource ={data}  xName='x' yName='y' size='size' type='Bubble' name='pound' opacity={0.5}>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let data = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];
export let data: Object[] = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];

Size mapping

Use the size property to map the size of each bubble to the value specified in the data source.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { bubbleData } from './datasource';
function App() {
    return <ChartComponent id='charts'>
      <Inject services={[BubbleSeries]}/>
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={bubbleData} xName='x' yName='y' size='size' type='Bubble'>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries}
from'@syncfusion/ej2-react-charts';
import { bubbleData } from './datasource';

function App() {

    return <ChartComponent id='charts'>
      <Inject services={[BubbleSeries]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={bubbleData} xName='x' yName='y' size='size' type='Bubble'>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let bubbleData = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];
export let bubbleData: Object[] = [
    { x: 92.2,  y: 7.8,  size: 1.347,  text: 'China' },
    { x: 74,    y: 6.5,  size: 1.241,  text: 'India' },
    { x: 90.4,  y: 6.0,  size: 0.238,  text: 'Indonesia' },
    { x: 99.4,  y: 2.2,  size: 0.312,  text: 'US' },
    { x: 88.6,  y: 1.3,  size: 0.197,  text: 'Brazil' },
    { x: 99,    y: 0.7,  size: 0.0818, text: 'Germany' },
    { x: 72,    y: 2.0,  size: 0.0826, text: 'Egypt' },
    { x: 99.6,  y: 3.4,  size: 0.143,  text: 'Russia' },
    { x: 99,    y: 0.2,  size: 0.128,  text: 'Japan' },
    { x: 86.1,  y: 4.0,  size: 0.115,  text: 'Mexico' },
    { x: 92.6,  y: 6.6,  size: 0.096,  text: 'Philippines' },
    { x: 61.3,  y: 14.5, size: 0.162,  text: 'Nigeria' }
];

Empty points

Data points with null or undefined values are considered empty. Empty data points are ignored and not plotted on the chart.

Mode

Use the mode property to control handling of empty points. Available modes: Gap, Drop, Zero, Average. The default mode is Gap.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { data } from './datasource';
function App() {
    const primaryxAxis = { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 };
    const primaryyAxis = { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 };
    const emptyPoint = {
        mode: 'Gap',
      };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource={data} xName='x' yName='y' size='size' type='Bubble' name='pound' emptyPointSettings={emptyPoint}>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { AxisModel, ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries}
from'@syncfusion/ej2-react-charts';
import { data } from './datasource';

function App() {
const primaryxAxis: AxisModel= { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 }  ;
const primaryyAxis: AxisModel= { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 }  ;
const emptyPoint: object = {
  mode: 'Gap',
};
  return <ChartComponent id='charts'
           primaryXAxis={ primaryxAxis }
           primaryYAxis={ primaryyAxis }
           title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource ={data}  xName='x' yName='y' size='size' type='Bubble' name='pound' emptyPointSettings={emptyPoint}>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let data = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: null, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: undefined, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];
export let data: Object[] = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: null, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: undefined, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];

Fill

Use the fill property to set the fill color for empty points.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { data } from './datasource';
function App() {
    const primaryxAxis = { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 };
    const primaryyAxis = { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 };
    const emptyPoint = {
        mode: 'Zero', fill: 'red'
      };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource={data} xName='x' yName='y' size='size' type='Bubble' name='pound' emptyPointSettings={emptyPoint}>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { AxisModel, ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries}
from'@syncfusion/ej2-react-charts';
import { data } from './datasource';

function App() {
const primaryxAxis: AxisModel= { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 }  ;
const primaryyAxis: AxisModel= { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 }  ;
const emptyPoint: object = {
  mode: 'Zero', fill: 'red'
};
  return <ChartComponent id='charts'
           primaryXAxis={ primaryxAxis }
           primaryYAxis={ primaryyAxis }
           title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource ={data}  xName='x' yName='y' size='size' type='Bubble' name='pound' emptyPointSettings={emptyPoint}>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let data = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: null, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: undefined, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];
export let data: Object[] = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: null, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: undefined, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];

Border

Use the border property to customize the border width and color for empty points.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { data } from './datasource';
function App() {
    const primaryxAxis = { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 };
    const primaryyAxis = { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 };
    const emptyPoint = {
      mode: 'Zero', fill: 'red', border: {width: 1.5, color:'green'}
      };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource={data} xName='x' yName='y' size='size' type='Bubble' name='pound' emptyPointSettings={emptyPoint}>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { AxisModel, ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries}
from'@syncfusion/ej2-react-charts';
import { data } from './datasource';

function App() {
const primaryxAxis: AxisModel= { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 }  ;
const primaryyAxis: AxisModel= { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 }  ;
const emptyPoint: object = {
  mode: 'Zero', fill: 'red', border: {width: 1.5, color:'green'}
};
  return <ChartComponent id='charts'
           primaryXAxis={ primaryxAxis }
           primaryYAxis={ primaryyAxis }
           title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource ={data}  xName='x' yName='y' size='size' type='Bubble' name='pound' emptyPointSettings={emptyPoint}>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let data = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: null, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: undefined, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];
export let data: Object[] = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: null, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: undefined, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];

Events

Series render

The seriesRender event enables modification of series properties (for example, data, fill, or name) immediately before rendering. Use this event to adjust series appearance or to dynamically swap data sources.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { data } from './datasource';
function App() {
    const primaryxAxis = { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 };
    const primaryyAxis = { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 };
    const seriesRender = (args) => {
      args.fill = '#ff6347';
    };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} seriesRender={seriesRender} title='GDP vs Literacy Rate'>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource={data} xName='x' yName='y' size='size' type='Bubble' name='pound'>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { AxisModel, ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries, ISeriesRenderEventArgs}
from'@syncfusion/ej2-react-charts';
import { data } from './datasource';
import { EmitType } from '@syncfusion/ej2-base';
function App() {
const primaryxAxis: AxisModel= { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 }  ;
const primaryyAxis: AxisModel= { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 }  ;
const seriesRender: EmitType<ISeriesRenderEventArgs> = (args: ISeriesRenderEventArgs): void => {
  args.fill = '#ff6347';
};
  return <ChartComponent id='charts'
           primaryXAxis={ primaryxAxis }
           primaryYAxis={ primaryyAxis }
           title='GDP vs Literacy Rate'>
            seriesRender={seriesRender}
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource ={data}  xName='x' yName='y' size='size' type='Bubble' name='pound' seriesRender={seriesRender}>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let data = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: 7, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: 4, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];
export let data: Object[] = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: 7, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: 4, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];

Point render

The pointRender event provides a hook to customize each data point (for example, marker shape, border, or fill) before it is drawn. Use this to apply per-point styling rules or conditional formatting.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, BubbleSeries } from '@syncfusion/ej2-react-charts';
import { data } from './datasource';
function App() {
    const primaryxAxis = { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 };
    const primaryyAxis = { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 };
    const pointRender = (args) => {
      const seriesRender = (args) => {
        args.series.bearFillColor = '#ff6347';
        args.series.bullFillColor = '#009cb8';
      };
    };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='GDP vs Literacy Rate' pointRender={pointRender}>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource={data} xName='x' yName='y' size='size' type='Bubble' name='pound'>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>;
}
;
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { AxisModel, ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject,
         BubbleSeries, IPointRenderEventArgs}
from'@syncfusion/ej2-react-charts';
import { data } from './datasource';
import { EmitType } from '@syncfusion/ej2-base';
function App() {
const primaryxAxis: AxisModel= { title: 'Literacy Rate', minimum: 60, maximum: 100, interval: 5 }  ;
const primaryyAxis: AxisModel= { title: 'GDP growth rate', minimum: -2, maximum: 16, interval: 2 }  ;
const pointRender: EmitType<IPointRenderEventArgs> = (args: IPointRenderEventArgs): void => {
  args.fill = '#ff6347';
};
  return <ChartComponent id='charts'
           primaryXAxis={ primaryxAxis }
           primaryYAxis={ primaryyAxis }
           title='GDP vs Literacy Rate' pointRender={pointRender}>
            <Inject services={[BubbleSeries]}/>
            <SeriesCollectionDirective>
                <SeriesDirective dataSource ={data}  xName='x' yName='y' size='size' type='Bubble' name='pound'>
                </SeriesDirective>
            </SeriesCollectionDirective>
          </ChartComponent>

};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let data = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: 7, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: 4, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];
export let data: Object[] = [
    { x: 92.2, y: 7.8, size: 1.347 },
    { x: 74, y: 6.5, size: 1.241 },
    { x: 90.4, y: 7, size: 0.238 },
    { x: 99.4, y: 2.2, size: 0.312 },
    { x: 88.6, y: 1.3, size: 0.197 },
    { x: 99, y: 0.7, size: 0.0818 },
    { x: 72, y: 2.0, size: 0.0826 },
    { x: 99.6, y: 3.4, size: 0.143 },
    { x: 99, y: 4, size: 0.128 },
    { x: 86.1, y: 4.0, size: 0.115 },
    { x: 92.6, y: 6.6, size: 0.096 },
    { x: 61.3, y: 14.5, size: 0.162 },
];

See Also