100% Stacked area Chart in Vue Component

15 Dec 202424 minutes to read

100% Stacked area

To render a 100% stacked 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 type as StackingArea100 in your chart configuration. This indicates that the data should be represented as a 100% stacked area chart, where the cumulative values for each data point are expressed as a percentage of the total. This ensures that the sum of all series at each point is always 100%.

  • Inject the StackingAreaSeries module: Use the provide: { chart: [StackingAreaSeries]} method to inject the StackingAreaSeries module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering 100% stacked area series are available in your chart.

<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';

provide('chart', [StackingAreaSeries, DateTime, Legend]);

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison'
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  }
};
</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'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';

provide('chart', [StackingAreaSeries, DateTime, Legend]);

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison'
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  }
};
</script>
<style>
  #container {
    height: 350px;
  }
</style>

Series customization

The following properties can be used to customize the 100% stacked 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'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' fill='#ff4251'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' fill='#4C4C4C'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' fill='#794F1B'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' fill='#1a9a6f'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';

provide('chart', [StackingAreaSeries, DateTime, Legend]);

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' fill='#ff4251'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' fill='#4C4C4C'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' fill='#794F1B'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' fill='#1a9a6f'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison'
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  }
};
</script>
<style>
  #container {
    height: 350px;
  }
</style>

The fill property can be used to apply a gradient color to the 100% stacked 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'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' fill='url(#gradient1)'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' fill='url(#gradient2)'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' fill='url(#gradient3)'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' fill='url(#gradient4)'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';

provide('chart', [StackingAreaSeries, DateTime, Legend]);

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' fill='url(#gradient1)'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' fill='url(#gradient2)'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' fill='url(#gradient3)'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' fill='url(#gradient4)'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison'
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  }
};
</script>
<style>
  #container {
    height: 350px;
  }
</style>

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.

<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' opacity=0.5> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' opacity=0.5> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' opacity=0.5> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' 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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';

provide('chart', [StackingAreaSeries, DateTime, Legend]);

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' opacity=0.5> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' opacity=0.5> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' opacity=0.5> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' opacity=0.5> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison'
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  }
};
</script>
<style>
  #container {
    height: 350px;
  }
</style>

Border

Use the border property to customize the width, color and dash array of the series border.

<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' dashArray='5,5' :border='border'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' dashArray='5,5' :border='border1'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' dashArray='5,5' :border='border2'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' dashArray='5,5' :border='border3'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';
const border = { width: 2, color: '#ff4251', dashArray: "5,5" };
const border1 = { width: 2, color: '#4C4C4C', dashArray: "5,5" };
const border2 = { width: 2, color: '#794F1B', dashArray: "5,5" };
const border3 = { width: 2, color: '#1a9a6f', dashArray: "5,5" };

provide('chart', [StackingAreaSeries, DateTime, Legend]);

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' dashArray='5,5' :border='border'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' dashArray='5,5' :border='border1'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' dashArray='5,5' :border='border2'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' dashArray='5,5' :border='border3'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison',
      border: { width: 2, color: '#ff4251', dashArray: "5,5" },
      border1: { width: 2, color: '#4C4C4C', dashArray: "5,5" },
      border2: { width: 2, color: '#794F1B', dashArray: "5,5" },
      border3: { width: 2, color: '#1a9a6f', dashArray: "5,5" }
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  }
};
</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 define how empty or missing data points are handled in the series. The default mode for empty points is Gap.

<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' :emptyPointSettings='emptyPointSettings'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' :emptyPointSettings='emptyPointSettings1'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: null, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: undefined, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';
const emptyPointSettings = { 
  mode: 'Zero' 
};
const emptyPointSettings1 = { 
  mode: 'Average' 
};

provide('chart', [StackingAreaSeries, DateTime, Legend]);

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' :emptyPointSettings='emptyPointSettings'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' :emptyPointSettings='emptyPointSettings1'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: null, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: undefined, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison',
      emptyPointSettings: { 
        mode: 'Zero' 
      },
      emptyPointSettings1: { 
        mode: 'Average' 
      }
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  }
};
</script>
<style>
  #container {
    height: 350px;
  }
</style>

Fill

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

<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' :marker='marker' :emptyPointSettings='emptyPointSettings'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' :marker='marker' :emptyPointSettings='emptyPointSettings1'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' :marker='marker1'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: null, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: undefined, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';
const emptyPointSettings = { 
  mode: 'Zero',
  fill: 'red'
};
const emptyPointSettings1 = { 
  mode: 'Average',
  fill: 'red'
};
const marker = { 
  visible: true, 
  width: 7, 
  height: 7, 
  isFilled: true 
};
const marker1 = { 
  visible: true, 
  width: 4, 
  height: 4, 
  isFilled: true 
};

provide('chart', [StackingAreaSeries, DateTime, Legend]);

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' :marker='marker' :emptyPointSettings='emptyPointSettings'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' :marker='marker' :emptyPointSettings='emptyPointSettings1'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' :marker='marker1'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: null, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: undefined, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison',
      emptyPointSettings: { 
        mode: 'Zero',
        fill: 'red'
      },
      emptyPointSettings1: { 
        mode: 'Average',
        fill: 'red'
      },
      marker: { 
        visible: true, 
        width: 7, 
        height: 7, 
        isFilled: true 
      },
      marker1: { 
        visible: true, 
        width: 4, 
        height: 4, 
        isFilled: true 
      }
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  }
};
</script>
<style>
  #container {
    height: 350px;
  }
</style>

Border

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

<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' :marker='marker' :emptyPointSettings='emptyPointSettings'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' :marker='marker' :emptyPointSettings='emptyPointSettings1'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' :marker='marker1'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: null, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: undefined, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';
const emptyPointSettings = { 
  mode: 'Zero',
  fill: 'red',
  border: { 
    width: 2, 
    color: 'green' 
  }
};
const emptyPointSettings1 = { 
  mode: 'Average',
  fill: 'red',
  border: { 
    width: 2, 
    color: 'green' 
  }
};
const marker = { 
  visible: true, 
  width: 7, 
  height: 7, 
  isFilled: true 
};
const marker1 = { 
  visible: true, 
  width: 4, 
  height: 4, 
  isFilled: true 
};

provide('chart', [StackingAreaSeries, DateTime, Legend]);

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' :marker='marker' :emptyPointSettings='emptyPointSettings'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' :marker='marker' :emptyPointSettings='emptyPointSettings1'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' :marker='marker1'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: null, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: undefined, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison',
      emptyPointSettings: { 
        mode: 'Zero',
        fill: 'red',
        border: { 
          width: 2, 
          color: 'green' 
        }
      },
      emptyPointSettings1: { 
        mode: 'Average',
        fill: 'red',
        border: { 
          width: 2, 
          color: 'green' 
        }
      },
      marker: { 
        visible: true, 
        width: 7, 
        height: 7, 
        isFilled: true 
      },
      marker1: { 
        visible: true, 
        width: 4, 
        height: 4, 
        isFilled: true 
      }
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  }
};
</script>
<style>
  #container {
    height: 350px;
  }
</style>

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.

<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :seriesRender='seriesRender'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';

provide('chart', [StackingAreaSeries, DateTime, Legend]);

const seriesRender = function (args) {
  if (args.series.index === 0) {
      args.fill = '#ff4251';
  }
  else if (args.series.index === 1) {
      args.fill = '#4C4C4C';
  }
  else if (args.series.index === 2) {
      args.fill = '#794F1B';
  }
  else if (args.series.index === 3) {
      args.fill = '#1a9a6f';
  }
};

</script>
<style>
  #container {
    height: 350px;
  }
</style>
<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :seriesRender='seriesRender'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison'
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  },
  methods: {
    seriesRender: function (args) {
      if (args.series.index === 0) {
          args.fill = '#ff4251';
      }
      else if (args.series.index === 1) {
          args.fill = '#4C4C4C';
      }
      else if (args.series.index === 2) {
          args.fill = '#794F1B';
      }
      else if (args.series.index === 3) {
          args.fill = '#1a9a6f';
      }
    }
  }
};
</script>
<style>
  #container {
    height: 350px;
  }
</style>

Point render

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

<template>
  <div id="app">
    <ejs-chart id="container" :title='title' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :pointRender='pointRender'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' :marker='marker'> </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, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

const seriesData = [
  { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
  { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
  { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
  { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
  { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
  { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
  { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
  { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
  { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
];
const primaryXAxis = {
  valueType: 'DateTime',
  title: 'Years',
  intervalType: 'Years',
  labelFormat: 'y',
  edgeLabelPlacement: 'Shift'
};
const primaryYAxis = {
  title: 'Temperature (%)',
  labelFormat: '{value}%',
  rangePadding: 'None'
};
const title = 'Annual Temperature Comparison';
const marker = { 
  visible: true, 
  width: 7, 
  height: 7, 
  isFilled: true 
};

provide('chart', [StackingAreaSeries, DateTime, Legend]);

const pointRender = function (args) {
  if (args.point.index % 2 !==0) {
      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' :pointRender='pointRender'>
      <e-series-collection>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y' name='USA' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y1' name='UK' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y2' name='Canada' :marker='marker'> </e-series>
        <e-series :dataSource='seriesData' type='StackingArea100' xName='x' yName='y3' name='China' :marker='marker'> </e-series>
      </e-series-collection>
    </ejs-chart>
  </div>
</template>
<script>

import { ChartComponent, SeriesCollectionDirective, SeriesDirective, StackingAreaSeries, DateTime, Legend } from "@syncfusion/ej2-vue-charts";

export default {
  name: "App",
  components: {
    'ejs-chart': ChartComponent,
    'e-series-collection': SeriesCollectionDirective,
    'e-series': SeriesDirective
  },
  data() {
    return {
      seriesData: [
        { x: new Date(2006, 0, 1), y: 34, y1: 51, y2: 14, y3: 37 },
        { x: new Date(2007, 0, 1), y: 20, y1: 26, y2: 34, y3: 15 },
        { x: new Date(2008, 0, 1), y: 40, y1: 37, y2: 73, y3: 53 },
        { x: new Date(2009, 0, 1), y: 51, y1: 51, y2: 51, y3: 51 },
        { x: new Date(2010, 0, 1), y: 26, y1: 26, y2: 26, y3: 26 },
        { x: new Date(2011, 0, 1), y: 37, y1: 37, y2: 37, y3: 37 },
        { x: new Date(2012, 0, 1), y: 54, y1: 43, y2: 12, y3: 54 },
        { x: new Date(2013, 0, 1), y: 44, y1: 23, y2: 16, y3: 44 },
        { x: new Date(2014, 0, 1), y: 48, y1: 55, y2: 34, y3: 23 }
      ],
      primaryXAxis: {
        valueType: 'DateTime',
        title: 'Years',
        intervalType: 'Years',
        labelFormat: 'y',
        edgeLabelPlacement: 'Shift'
      },
      primaryYAxis: {
        title: 'Temperature (%)',
        labelFormat: '{value}%',
        rangePadding: 'None'
      },
      title: 'Annual Temperature Comparison',
      marker: { 
        visible: true, 
        width: 7, 
        height: 7, 
        isFilled: true 
      }
    };
  },
  provide: {
    chart: [StackingAreaSeries, DateTime, Legend]
  },
  methods: {
    pointRender: function (args) {
      if (args.point.index % 2 !==0) {
          args.fill = '#ff6347';
      }
      else {
          args.fill = '#009cb8';
      }
    }
  }
};
</script>
<style>
  #container {
    height: 350px;
  }
</style>

See also