How can I help you?
Step Area Chart in Vue Charts
3 Feb 202624 minutes to read
Step Area
To render a step area 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:
-
Set the series type: Define the series
typeasStepAreain 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 the
provide: { chart: [StepAreaSeries]}method to inject theStepAreaSeriesmodule into your chart. This step is essential, as it ensures that the necessary functionalities for rendering step area series are available in your chart.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>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.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Series customization
The following properties can be used to customize the step area series.
Fill
The fill property determines the color applied to the series.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' fill='#87CEEB'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' fill='#87CEEB'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>The fill property can be used to apply a gradient color to the step area series. By configuring this property with gradient values, you can create a visually appealing effect in which the color transitions smoothly from one shade to another.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' fill='url(#gradient)'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' fill='url(#gradient)'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Opacity
The opacity property controls the transparency of the fill and affects how the series blends with background or overlapping series.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' opacity=0.5> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' opacity=0.5> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Border
Use the border property to configure the border width, color, and dasharray of the step area series.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' dashArray='5,5' :border='border'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
const border: {
width: 2,
color: '#FFA500',
dashArray: "5,5"
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' dashArray='5,5' :border='border'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
},
border: {
width: 2,
color: '#FFA500',
dashArray: "5,5"
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Step
Use the step property to change the position of the steps in a step area series.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' step='Right'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' step='Right'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>No risers
You can eliminate the vertical lines between points by using the noRisers property in a series. This approach is useful for highlighting trends without the distraction of risers.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' opacity=0.1 :border='border' noRisers=true> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = "England - Run Rate";
const border = { width: 1.5 };
const tooltip = { enable: true };
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' opacity=0.1 :border='border' noRisers=true> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
"ejs-chart": ChartComponent,
"e-series-collection": SeriesCollectionDirective,
"e-series": SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: "England - Run Rate",
border: { width: 1.5 },
tooltip: {
enable: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>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.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' :border='border' :emptyPointSettings='emptyPointSettings'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
const border = {
width: 2,
color: 'green'
};
const emptyPointSettings = {
mode: 'Zero'
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' :border='border' :emptyPointSettings='emptyPointSettings'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
},
border: {
width: 2,
color: 'green'
},
emptyPointSettings: {
mode: 'Zero'
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Fill
Use the fill property to set the fill color for empty points.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' :border='border' :marker='marker' :emptyPointSettings='emptyPointSettings'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
const border = {
width: 2,
color: 'green'
};
const emptyPointSettings = {
mode: 'Zero',
fill: 'red'
};
const marker = {
visible: true,
width: 7,
height: 7,
isFilled: true
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' :border='border' :marker='marker' :emptyPointSettings='emptyPointSettings'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
},
border: {
width: 2,
color: 'green'
},
emptyPointSettings: {
mode: 'Zero',
fill: 'red'
},
marker: {
visible: true,
width: 7,
height: 7,
isFilled: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Border
Use the border property to customize the border width and color for empty points.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' :border='border' :marker='marker' :emptyPointSettings='emptyPointSettings'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
const border = {
width: 2,
color: 'green'
};
const emptyPointSettings = {
mode: 'Zero',
fill: 'red',
border: {
width: 2,
color: 'green'
}
};
const marker = {
visible: true,
width: 7,
height: 7,
isFilled: true
};
provide('chart', [StepAreaSeries, Tooltip]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' :border='border' :marker='marker' :emptyPointSettings='emptyPointSettings'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
},
border: {
width: 2,
color: 'green'
},
emptyPointSettings: {
mode: 'Zero',
fill: 'red',
border: {
width: 2,
color: 'green'
}
},
marker: {
visible: true,
width: 7,
height: 7,
isFilled: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>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.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip' :seriesRender='seriesRender'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
provide('chart', [StepAreaSeries, Tooltip]);
const seriesRender = function (args) {
args.fill = '#ff6347';
};
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip' :seriesRender='seriesRender'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
},
methods: {
seriesRender: function (args) {
args.fill = '#ff6347';
}
}
};
</script>
<style>
#container {
height: 350px;
}
</style>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.
<template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip' :pointRender='pointRender'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' :marker='marker' :border='border'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script setup>
import { provide } from "vue";
import { ChartComponent as EjsChart, SeriesCollectionDirective as ESeriesCollection, SeriesDirective as ESeries, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ 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 }
];
const primaryXAxis = {
title: 'Overs'
};
const primaryYAxis = {
title: 'Runs'
};
const title = 'England - Run Rate';
const tooltip = {
enable: true
};
const marker = {
visible: true,
isFilled: true,
width: 7,
height: 7
};
const border = {
width: 2,
color: 'green'
};
provide('chart', [StepAreaSeries, Tooltip]);
const pointRender = function (args) {
if (args.point.y <= 8) {
args.fill = '#ff6347';
}
else {
args.fill = '#009cb8';
}
};
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :tooltip='tooltip' :pointRender='pointRender'>
<e-series-collection>
<e-series :dataSource='seriesData' type='StepArea' xName='x' yName='y' :marker='marker' :border='border'> </e-series>
</e-series-collection>
</ejs-chart>
</div>
</template>
<script>
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StepAreaSeries, Tooltip } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart': ChartComponent,
'e-series-collection': SeriesCollectionDirective,
'e-series': SeriesDirective
},
data() {
return {
seriesData: [
{ 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 }
],
primaryXAxis: {
title: 'Overs'
},
primaryYAxis: {
title: 'Runs'
},
title: 'England - Run Rate',
tooltip: {
enable: true
},
marker: {
visible: true,
isFilled: true,
width: 7,
height: 7
},
border: {
width: 2,
color: 'green'
}
};
},
provide: {
chart: [StepAreaSeries, Tooltip]
},
methods: {
pointRender: function (args) {
if (args.point.y <= 8) {
args.fill = '#ff6347';
}
else {
args.fill = '#009cb8';
}
}
}
};
</script>
<style>
#container {
height: 350px;
}
</style>