Bubble in React Chart component

14 Oct 202424 minutes to read

Scatter

To render a scatter 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 Scatter in your chart configuration. This indicates that the data should be displayed as individual points scattered across the chart.

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

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';
function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker = { width: 15, height: 15 };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' name='Male' type='Scatter' marker={marker}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' name='Female' type='Scatter' marker={marker}>
        </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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, Marker}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker = { width: 15, height: 15 };

  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' name='Male' type='Scatter'
          marker={marker}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' name='Female' type='Scatter'
          marker={marker}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

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, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';
function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker = { width: 15, height: 15 };
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' name='Male' type='Scatter' marker={marker}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' name='Female' type='Scatter' marker={marker}>
        </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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, Marker}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker = { width: 15, height: 15 };

  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' name='Male' type='Scatter'
          marker={marker}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' name='Female' type='Scatter'
          marker={marker}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

Series customization

The following properties can be used to customize the scatter 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, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker1 = { width: 10, height: 10, shape: 'Triangle' };
    const marker = { width: 12, height: 12, shape: 'Rectangle'};
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
      <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter' fill='red'
          marker={marker1}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' type='Scatter' fill='yellow'
          marker={marker}>
        </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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, Marker}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker1 = { width: 10, height: 10, shape: 'Triangle' };
  const marker = { width: 12, height: 12, shape: 'Rectangle'};

  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter' fill='red'
          marker={marker1}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' type='Scatter' fill='yellow'
          marker={marker}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

Opacity

The opacity property specifies the transparency level of the fill. Adjusting this property allows you to control how opaque or transparent the fill color of the series appears.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker1 = { width: 10, height: 10, shape: 'Triangle' };
    const marker = { width: 12, height: 12, shape: 'Rectangle'};
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
      <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter' opacity={0.4}
          marker={marker1}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' type='Scatter' opacity={0.4}
          marker={marker}>
        </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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, Marker}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker1 = { width: 10, height: 10, shape: 'Triangle' };
  const marker = { width: 12, height: 12, shape: 'Rectangle'};

  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter' opacity={0.4}
          marker={marker1}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' type='Scatter' opacity={0.4}
          marker={marker}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

Shape

The shape property allows you to customize the appearance of the markers by specifying different shapes.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker1 = { width: 10, height: 10, shape: 'Star' };
    const marker = { width: 12, height: 12, shape: 'Circle'};
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
      <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter'
          marker={marker1}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' type='Scatter'
          marker={marker}>
        </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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, Marker}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker1 = { width: 10, height: 10, shape: 'Star' };
  const marker = { width: 12, height: 12, shape: 'Circle'};

  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter' opacity={0.4}
          marker={marker1}>
        </SeriesDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='female' type='Scatter' opacity={0.4}
          marker={marker}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

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 define how empty or missing data points are handled in the series. The default mode for empty points is Gap.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker1 = { width: 10, height: 10 };
    const emptyPoint = { mode: 'Gap'};
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
      <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter'
          marker={marker1} 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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, Marker}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker1 = { width: 10, height: 10};
  const emptyPoint = { mode: 'Gap'};
  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter'
          marker={marker1} emptyPointSettings={emptyPoint}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: null, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: undefined, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: null, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: undefined, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

Fill

Use the fill property to customize the fill color of empty points in the series.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker1 = { width: 10, height: 10 };
    const emptyPoint = { mode: 'Average', fill: 'red'};
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
      <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter'
          marker={marker1} 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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, Marker}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker1 = { width: 10, height: 10};
  const emptyPoint = { mode: 'Average', fill: 'red'};
  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter' 
          marker={marker1} emptyPointSettings={emptyPoint}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: null, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: undefined, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: null, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: undefined, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

Border

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

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker1 = { width: 10, height: 10 };
    const emptyPoint = { mode: 'Average', fill: 'red', border: {width:1.5, color: 'green'}};
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
      <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter'
          marker={marker1} 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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, Marker}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker1 = { width: 10, height: 10};
  const emptyPoint = {  mode: 'Average', fill: 'red', border: {width:1.5, color: 'green'}};
  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight'>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter' 
          marker={marker1} emptyPointSettings={emptyPoint}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: null, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: undefined, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: null, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: undefined, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

Events

Series render

The seriesRender event allows you to customize series properties, such as data, fill, and name, before they are rendered on the chart.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker1 = { width: 10, height: 10 };
    const seriesRender = (args) => {
      args.fill = '#ff6347';
  }
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight' seriesRender={seriesRender}>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
      <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter'
          marker={marker1} >
        </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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, ISeriesRenderEventArgs}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker1 = { width: 10, height: 10};
  const seriesRender = (args: ISeriesRenderEventArgs) => {
    args.fill = '#ff6347';
}
  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight' seriesRender={seriesRender}>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter' 
          marker={marker1}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

Point render

The pointRender event allows you to customize each data point before it is rendered on the chart.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, Legend, Category, Tooltip, DataLabel, ScatterSeries } from '@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
    const primaryxAxis = {
        title: 'Height (cm)', minimum: 130, maximum: 180,
        edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
    };
    const primaryyAxis = {
        title: 'Weight (kg)', minimum: 30, maximum: 100,
        labelFormat: '{value}kg', rangePadding: 'None'
    };
    const marker1 = { width: 10, height: 10 };
    const pointRender = (args) => {
      if (args.point.index % 2 !== 0) {
        args.fill = '#ff6347';
    }
    else {
        args.fill = '#009cb8';
    }
  }
    return <ChartComponent id='charts' primaryXAxis={primaryxAxis} primaryYAxis={primaryyAxis} title='Height Vs Weight' pointRender={pointRender}>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]}/>
      <SeriesCollectionDirective>
      <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter'
          marker={marker1} >
        </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,
         Legend, Category, Tooltip, DataLabel, ScatterSeries, IPointRenderEventArgs}
from'@syncfusion/ej2-react-charts';
import { scatterData } from './datasource';

function App() {
  const primaryxAxis: AxisModel = {
    title: 'Height (cm)', minimum: 130, maximum: 180,
    edgeLabelPlacement: 'Shift', labelFormat: '{value}cm'
  };
  const primaryyAxis: AxisModel = {
    title: 'Weight (kg)', minimum: 30, maximum: 100,
    labelFormat: '{value}kg', rangePadding: 'None'
  };
  const marker1 = { width: 10, height: 10};
  const pointRender = (args: IPointRenderEventArgs) => {
    if (args.point.index % 2 !== 0) {
      args.fill = '#ff6347';
  }
  else {
      args.fill = '#009cb8';
  }
}
  return <ChartComponent id='charts'
      primaryXAxis={primaryxAxis}
      primaryYAxis={primaryyAxis}
      title='Height Vs Weight' pointRender={pointRender}>
      <Inject services={[ScatterSeries, Legend, Tooltip, DataLabel, Category]} />
      <SeriesCollectionDirective>
        <SeriesDirective dataSource={scatterData} xName='height' yName='male' type='Scatter' 
          marker={marker1}>
        </SeriesDirective>
      </SeriesCollectionDirective>
    </ChartComponent>
  
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));
export let scatterData = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];
export let scatterData: Object[] = [
    { height: 130, male: 35, female: 32 },
    { height: 132, male: 38, female: 33 },
    { height: 135, male: 41, female: 38 },
    { height: 137, male: 43, female: 40 },
    { height: 140, male: 45, female: 42 },
    { height: 142, male: 46, female: 42.5 },
    { height: 145, male: 48, female: 43 },
    { height: 147, male: 50, female: 44 },
    { height: 150, male: 52, female: 45 },
    { height: 152, male: 55, female: 45 },
    { height: 155, male: 58, female: 46 },
    { height: 157, male: 60, female: 48 },
    { height: 160, male: 63, female: 51 },
    { height: 162, male: 70, female: 54 },
    { height: 165, male: 75, female: 58 },
    { height: 167, male: 78, female: 62 },
    { height: 170, male: 82, female: 68 },
    { height: 172, male: 87, female: 72 },
    { height: 175, male: 89, female: 78 },
    { height: 177, male: 92, female: 82 },
    { height: 180, male: 95, female: 85 }
];

See Also