Step Area Chart in TypeScript Charts

Step Area

To render a step area series in your chart, follow the steps below:

  • Set the series type: Define the series type as StepArea in your chart configuration. This indicates that the data should be represented as a step area chart, which connects data points with vertical and horizontal lines, creating a step like appearance.

  • Inject the StepAreaSeries module: Use Chart.Inject(StepAreaSeries) to register the StepAreaSeries module.

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea'
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

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 { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea'
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

Series customization

The following properties can be used to customize the step area series.

Solid fill

The fill property determines the color applied to the series.

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea', fill: '#87CEEB'
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

Gradient fill

The fill property also applies an SVG gradient to a step area series. Define the gradient within an SVG <defs> element using a unique ID, and assign it to the series in the url(#gradientId) format.

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea', fill: 'url(#gradient)'
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
    <svg style="width:1px; height:1px">
        <defs>
            <linearGradient id="gradient">
                <stop offset="0%" style="stop-color: blue; stop-opacity:5" />
                <stop offset="50%" style="stop-color: violet; stop-opacity:5" />
            </linearGradient>
        </defs>
    </svg>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

Opacity

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

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea', opacity: 0.5
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

Border

Use the border property to configure the border width, color, and dash array of the step area series.

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea',
        border: { width: 2, color: '#FFA500', dashArray: '5,5' }
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

Step

Use the step property to change the position of the steps in a step area series. Available positions are Left, Center, and Right. The default is Left.

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea', step: 'Right'
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

No risers

You can eliminate the vertical lines between points by setting noRisers to true on the series. This approach is useful for highlighting trends without the distraction of risers.

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y', 
        opacity: 0.1, border: {width: 1.5},
        type: 'StepArea', noRisers: true
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

Empty points

Data points with null or undefined values are considered empty. Configure the emptyPointSettings on the series to control how empty data points are rendered.

Mode

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

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea',
        border: { width: 2, color: 'green' },
        emptyPointSettings: {
            mode: 'Zero'
        }
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: null },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: undefined }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

Fill

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

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea',
        border: { width: 2, color: 'green' },
        marker: { visible: true, width: 7, height: 7, isFilled: true },
        emptyPointSettings: {
            mode: 'Zero',
            fill: 'red'
        }
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: null },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: undefined }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

Border

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

import { Chart, StepAreaSeries, Tooltip } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea',
        border: { width: 2, color: 'green' },
        marker: { visible: true, width: 7, height: 7, isFilled: true },
        emptyPointSettings: {
            mode: 'Zero',
            fill: 'red',
            border: { width: 2, color: 'green' }
        }
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: null },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: undefined }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

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 { Chart, StepAreaSeries, Tooltip, ISeriesRenderEventArgs } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea'
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    },
    seriesRender: (args: ISeriesRenderEventArgs) => {
        args.fill = '#ff6347';
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

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 { Chart, StepAreaSeries, Tooltip, IPointRenderEventArgs } from '@syncfusion/ej2-charts';
import { chartData } from './datasource.ts';
Chart.Inject(StepAreaSeries, Tooltip);

let chart: Chart = new Chart({
    primaryXAxis: {
        title: 'Overs'
    },
    primaryYAxis: {
        title: 'Runs'
    },
    series:[{
        dataSource: chartData,
        xName: 'x', yName: 'y',
        type: 'StepArea',
        marker: { visible: true, isFilled: true, width: 7, height: 7 },
        border: { width: 2, color: 'green' }
    }],
    title: 'England - Run Rate',
    tooltip:{
        enable:true
    },
    pointRender: (args: IPointRenderEventArgs) => {
        if (args.point.y <= 8) {
            args.fill = '#ff6347';
        }
        else {
            args.fill = '#009cb8';
        }
    }
}, '#element');
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>
export let chartData: Object[] = [
    { x: 1, y: 7 },   { x: 2, y: 1 }, 
    { x: 3, y: 1 },   { x: 4, y: 14 }, 
    { x: 5, y: 1 },   { x: 6, y: 10 },
    { x: 7, y: 8 },   { x: 8, y: 6 }, 
    { x: 9, y: 10 },  { x: 10, y: 10 }, 
    { x: 11, y: 16 }, { x: 12, y: 6 },
    { x: 13, y: 14 }, { x: 14, y: 7 }, 
    { x: 15, y: 5 },  { x: 16, y: 2 }, 
    { x: 17, y: 14 }, { x: 18, y: 7 },
    { x: 19, y: 7 },  { x: 20, y: 10 }
];

Troubleshooting

The following list describes common issues you may encounter when working with the Step Area series and how to resolve them.

Chart does not render as a step area: Confirm the type property of each series is set to StepArea. Also ensure StepAreaSeries (plus Tooltip if tooltips are used) is registered with Chart.Inject(...) before the chart is initialized, or import the modules directly from @syncfusion/ej2-charts using ES module syntax.

Steps do not appear or appear in the wrong position: step accepts only Left, Center, and Right. Other values are ignored. Confirm the property is set on each series configuration object and that the chart is rendered with the StepArea series type.

Vertical risers are still drawn: The noRisers property is applicable only to step series (such as StepArea). Confirm the property is set on each series configuration object and that the chart is rendered with the StepArea series type.

Empty-point mode produces no visible point: The default mode is Gap, which leaves a gap between connected series. To render empty points, switch the mode to Zero or Average and (optionally) set a fill on emptyPointSettings.

See also