Polar in Angular Chart component
19 Sep 202424 minutes to read
Polar
To render a polar 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
asPolar
in your chart configuration. This indicates that the data should be represented as a polar chart, which is ideal for plotting data points on a circular graph. -
Inject the PolarSeries module: Use the
@NgModule.providers
method to inject thePolarSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar series are available in your chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { radarData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Line'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
ngOnInit(): void {
this.data = radarData;
this.primaryXAxis = {
title: 'Year', startAngle: 90,
minimum: 2004, maximum: 2012, interval: 1
};
this.title = 'Efficiency of oil-fired power production';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let radarData: Object[] = [{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
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 { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { radarData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Line'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
ngOnInit(): void {
this.data = radarData;
this.primaryXAxis = {
title: 'Year', startAngle: 90,
minimum: 2004, maximum: 2012, interval: 1
};
this.title = 'Efficiency of oil-fired power production';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let radarData: Object[] = [{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Draw Types
Use the drawType
property to change the series plotting type in a Polar chart to line, column, area, range column, spline, scatter, stacking area, spline area, or stacking column. The default value of drawType
is Line
.
Line
To render a line draw type, you need to follow a few steps to configure it correctly.
-
Set the Series Type: Define the series
drawType
asLine
in your chart configuration. This indicates that the data should be represented as a polar line chart, with lines connecting each data point. -
Inject the LineSeries Module: Use the
@NgModule.providers
method to inject theLineSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar line series are available in your chart.
The isClosed
property specifies whether to join the start and end points of a line series used in a polar chart to form a closed path. The default value of isClosed
is true.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { chartData } from './datasource'
import { Component, OnInit } from '@angular/core';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Line'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
ngOnInit(): void {
this.data = chartData;
this.primaryXAxis = {
title: 'Year',
minimum: 2004, maximum: 2012, interval: 1
};
this.primaryYAxis = {
minimum: 20, maximum: 40, interval: 5,
title: 'Efficiency',
labelFormat: '{value}%'
};
this.title = 'Efficiency of oil-fired power production';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let chartData: Object[] = [
{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Spline
To render a spline draw type, you need to follow a few steps to configure it correctly.
-
Set the Series Type: Define the series
drawType
asSpline
in your chart configuration. This indicates that the data should be represented as a polar spline chart, with smooth, curved lines connecting each data point. -
Inject the SplineSeries Module: Use the
@NgModule.providers
method to inject theSplineSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar spline series are available in your chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { chartData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Spline' name='London'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
ngOnInit(): void {
this.data = chartData;
this.primaryXAxis = {
title: 'Month',
valueType: 'Category'
};
this.primaryYAxis = {
minimum: -5, maximum: 35, interval: 10,
title: 'Temperature in Celsius',
labelFormat: '{value}C'
};
this.title = 'Climate Graph-2012';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let chartData: Object[] = [
{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Area
To render an area draw type, you need to follow a few steps to configure it correctly.
-
Set the Series Type: Define the series
drawType
asArea
in your chart configuration. This indicates that the data should be represented as a polar area chart, with filled areas below the lines connecting each data point. -
Inject the AreaSeries Module: Use the
@NgModule.providers
method to inject theAreaSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar area series are available in your chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { chartData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Area' name='London'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
ngOnInit(): void {
this.data = chartData;
this.primaryXAxis = {
title: 'Month',
valueType: 'Category'
};
this.primaryYAxis = {
minimum: -5, maximum: 35, interval: 10,
title: 'Temperature in Celsius',
labelFormat: '{value}C'
};
this.title = 'Climate Graph-2012';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
Stacked Area
To render a stacked area draw type, you need to follow a few steps to configure it correctly.
-
Set the Series Type: Define the series
drawType
asStackingArea
in your chart configuration. This indicates that the data should be represented as a polar stacked area chart, with areas stacked on top of each other, displaying the cumulative value of multiple series. -
Inject the StackingAreaSeries Module: Use the
@NgModule.providers
method to inject theStackingAreaSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar stacked area series are available in your chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { chartData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='StackingArea' name='Organic'> </e-series>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y1' drawType='StackingArea' name='Fair-trade'> </e-series>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y2' drawType='StackingArea' name='veg-Alternatives'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public data?: Object[];
ngOnInit(): void {
this.data = chartData;
this.primaryXAxis = {
valueType: 'Category',
};
this.title = 'Trend in Sales of Ethical Produce';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let chartData: Object[] = [
{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Column
To render a column draw type, you need to follow a few steps to configure it correctly.
-
Set the Series Type: Define the series
drawType
asColumn
in your chart configuration. This indicates that the data should be represented as a polar column chart, allowing for the comparison of values across categories. -
Inject the ColumnSeries Module: Use the
@NgModule.providers
method to inject theColumnSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar column series are available in your chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { chartData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Column' name='Gold'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public data?: Object[];
ngOnInit(): void {
this.data = chartData;
this.primaryXAxis = {
title: 'Countries'
};
this.title = 'Olympic Medals';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let chartData: Object[] = [
{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Stacked Column
To render a stacked column draw type, you need to follow a few steps to configure it correctly.
-
Set the Series Type: Define the series
drawType
asStackingColumn
in your chart configuration. This indicates that the data should be represented as a polar stacked column chart, with each column consisting of multiple segments stacked on top of each other. -
Inject the StackingColumnSeries Module: Use the
@NgModule.providers
method to inject theStackingColumnSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar stacked column series are available in your chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { chartData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='StackingColumn' name='UK'> </e-series>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y1' drawType='StackingColumn' name='Germany'> </e-series>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y2' drawType='StackingColumn' name='France'> </e-series>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y2' drawType='StackingColumn' name='Italy'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public data?: Object[];
ngOnInit(): void {
this.data = chartData;
this.primaryXAxis = {
title: 'Years',
valueType: 'Category'
};
this.title = 'Mobile Game Market by Country';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let chartData: object[] = [
{ x: 2000, y: 0.61, y1: 0.03, y2: 0.48},
{ x: 2001, y: 0.81, y1: 0.05, y2: 0.53 },
{ x: 2002, y: 0.91, y1: 0.06, y2: 0.57 },
{ x: 2003, y: 1, y1: 0.09, y2: 0.61 },
{ x: 2004, y: 1.19, y1: 0.14, y2: 0.63 },
{ x: 2005, y: 1.47, y1: 0.20, y2: 0.64 },
{ x: 2006, y: 1.74, y1: 0.29, y2: 0.66 },
{ x: 2007, y: 1.98, y1: 0.46, y2: 0.76 },
{ x: 2008, y: 1.99, y1: 0.64, y2: 0.77 },
{ x: 2009, y: 1.70, y1: 0.75, y2: 0.55 }
];
Range Column
To render a range column draw type, you need to follow a few steps to configure it correctly.
-
Set the Series Type: Define the series
drawType
asRangeColumn
in your chart configuration. This indicates that the data should be represented as a polar range column chart, where each column spans a range of values. -
Inject the RangeColumnSeries Module: Use the
@NgModule.providers
method to inject theRangeColumnSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar range column series are available in your chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { chartData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' high='high' low='low' drawType='RangeColumn' name='Gold'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
ngOnInit(): void {
this.data = chartData;
this.primaryXAxis = {
valueType: 'Category',
title: 'Months'
};
this.primaryYAxis = {
title: 'Temperature(Celsius)',
};
this.title = 'Maximum and Minimum Temperature';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let chartData: Object[] = [
{ x: 'Jan', low: 0.7, high: 6.1 },
{ x: 'Feb', low: 1.3, high: 6.3 },
{ x: 'Mar', low: 1.9, high: 8.5 },
{ x: 'Apr', low: 3.1, high: 10.8 },
{ x: 'May', low: 5.7, high: 14.40 },
{ x: 'Jun', low: 8.4, high: 16.90 },
{ x: 'Jul', low: 10.6, high: 19.20 },
{ x: 'Aug', low: 10.5, high: 18.9 },
{ x: 'Sep', low: 8.5, high: 16.1 },
{ x: 'Oct', low: 6.0, high: 12.5 },
{ x: 'Nov', low: 1.5, high: 6.9 },
{ x: 'Dec', low: 5.1, high: 12.1 }
];
Scatter
To render a scatter draw type, you need to follow a few steps to configure it correctly.
-
Set the Series Type: Define the series
drawType
asScatter
in your chart configuration. This indicates that the data should be represented as a polar scatter chart. -
Inject the ScatterSeries Module: Use the
@NgModule.providers
method to inject theScatterSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar scatter series are available in your chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { polarCategory } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Scatter' name='London'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
ngOnInit(): void {
this.data = polarCategory;
this.primaryXAxis = {
title: 'Month',
valueType: 'Category'
};
this.primaryYAxis = {
minimum: -5, maximum: 35, interval: 10,
title: 'Temperature in Celsius',
labelFormat: '{value}C'
};
this.title = 'Climate Graph-2012';
}
}
export let polarCategory: Object[] =[{ x: 'Jan', y: -1 }, { x: 'Feb', y: -1 }, { x: 'Mar', y: 2 },
{ x: 'Apr', y: 8 }, { x: 'May', y: 13 }, { x: 'Jun', y: 18 },
{ x: 'Jul', y: 21 }, { x: 'Aug', y: 20 }, { x: 'Sep', y: 16 },
{ x: 'Oct', y: 10 }, { x: 'Nov', y: 4 }, { x: 'Dec', y: 0 }];
export let stackedData: Object[] = [{ x: '2000', y: 0.61, y1: 0.03, y2: 0.48},
{ x: '2001', y: 0.81, y1: 0.05, y2: 0.53 },
{ x: '2002', y: 0.91, y1: 0.06, y2: 0.57 },
{ x: '2003', y: 1, y1: 0.09, y2: 0.61 },
{ x: '2004', y: 1.19, y1: 0.14, y2: 0.63 },
{ x: '2005', y: 1.47, y1: 0.20, y2: 0.64 },
{ x: '2006', y: 1.74, y1: 0.29, y2: 0.66 },
{ x: '2007', y: 1.98, y1: 0.46, y2: 0.76 },
{ x: '2008', y: 1.99, y1: 0.64, y2: 0.77 },
{ x: '2009', y: 1.70, y1: 0.75, y2: 0.55 }];
export let columnData: Object[] = [
{ country: "USA", gold: 50 },
{ country: "China", gold: 40 },
{ country: "Japan", gold: 70 },
{ country: "Australia", gold: 60 },
{ country: "France", gold: 50 },
{ country: "Germany", gold: 40 },
{ country: "Italy", gold: 40 },
{ country: "Sweden", gold: 30 }];
export let data: Object[] = [
{ x: '2014', y: 111.1, y1: 76.9, y2: 66.1, y3: 34.1 },
{ x: '2015', y: 127.3, y1: 99.5, y2: 79.3, y3: 38.2 },
{ x: '2016', y: 143.4, y1: 121.7, y2: 91.3, y3: 44.0 },
{ x: '2017', y: 159.9, y1: 142.5, y2: 102.4, y3: 51.6 },
{ x: '2018', y: 175.4, y1: 166.7, y2: 112.9, y3: 61.9 },
{ x: '2019', y: 189.0, y1: 182.9, y2: 122.4, y3: 71.5 },
{ x: '2020', y: 202.7, y1: 197.3, y2: 120.9, y3: 82.0 }
];
export let rangeData: Object[] = [
{ x: 'Jan', low: 0.7, high: 6.1 }, { x: 'Feb', low: 1.3, high: 6.3 }, { x: 'Mar', low: 1.9, high: 8.5 },
{ x: 'Apr', low: 3.1, high: 10.8 }, { x: 'May', low: 5.7, high: 14.40 }, { x: 'Jun', low: 8.4, high: 16.90 },
{ x: 'Jul', low: 10.6,high: 19.20 }, { x: 'Aug', low: 10.5,high: 18.9 }, { x: 'Sep', low: 8.5, high: 16.1 },
{ x: 'Oct', low: 6.0, high: 12.5 }, { x: 'Nov', low: 1.5, high: 6.9 }, { x: 'Dec', low: 5.1, high: 12.1 }];
export let radarData: Object[] = [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 },
{ x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }];
Spline area
To render an spline area draw type, you need to follow a few steps to configure it correctly.
-
Set the Series Type: Define the series
drawType
asSplineArea
in your chart configuration. This indicates that the data should be represented as a polar spline area chart, where the series is drawn with smooth, curved lines connecting each data point, and the area beneath the line is filled with color. -
Inject the SplineAreaSeries Module: Use the
@NgModule.providers
method to inject theSplineAreaSeriesService
module into your chart. This step is essential, as it ensures that the necessary functionalities for rendering polar spline area series are available in your chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { chartData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='SplineArea' name='Gold'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
ngOnInit(): void {
this.data = chartData;
this.primaryXAxis = {
title: 'Months'
};
this.primaryYAxis = {
title: 'Temperature(Celsius)',
};
this.title = 'Maximum and Minimum Temperature';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let chartData: Object[] = [
{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Series Customization
Start angle
You can customize the start angle of the polar series using startAngle
property. By default, startAngle
is 0 degree.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { radarData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Line'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
ngOnInit(): void {
this.data = radarData;
this.primaryXAxis = {
title: 'Year', startAngle: 90,
minimum: 2004, maximum: 2012, interval: 1
};
this.title = 'Efficiency of oil-fired power production';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let radarData: Object[] = [{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Radius
You can customize the radius of the polar series and polar series using coefficient
property. By default, coefficient
is 100.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { radarData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Line'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public data?: Object[];
ngOnInit(): void {
this.data = radarData;
this.primaryXAxis = {
title: 'Year', coefficient: 50,
minimum: 2004, maximum: 2012, interval: 1
};
this.title = 'Efficiency of oil-fired power production';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let polarCategory: Object[] =[{ x: 'Jan', y: -1 }, { x: 'Feb', y: -1 }, { x: 'Mar', y: 2 },
{ x: 'Apr', y: 8 }, { x: 'May', y: 13 }, { x: 'Jun', y: 18 },
{ x: 'Jul', y: 21 }, { x: 'Aug', y: 20 }, { x: 'Sep', y: 16 },
{ x: 'Oct', y: 10 }, { x: 'Nov', y: 4 }, { x: 'Dec', y: 0 }];
export let stackedData: Object[] = [{ x: '2000', y: 0.61, y1: 0.03, y2: 0.48},
{ x: '2001', y: 0.81, y1: 0.05, y2: 0.53 },
{ x: '2002', y: 0.91, y1: 0.06, y2: 0.57 },
{ x: '2003', y: 1, y1: 0.09, y2: 0.61 },
{ x: '2004', y: 1.19, y1: 0.14, y2: 0.63 },
{ x: '2005', y: 1.47, y1: 0.20, y2: 0.64 },
{ x: '2006', y: 1.74, y1: 0.29, y2: 0.66 },
{ x: '2007', y: 1.98, y1: 0.46, y2: 0.76 },
{ x: '2008', y: 1.99, y1: 0.64, y2: 0.77 },
{ x: '2009', y: 1.70, y1: 0.75, y2: 0.55 }];
export let columnData: Object[] = [
{ country: "USA", gold: 50 },
{ country: "China", gold: 40 },
{ country: "Japan", gold: 70 },
{ country: "Australia", gold: 60 },
{ country: "France", gold: 50 },
{ country: "Germany", gold: 40 },
{ country: "Italy", gold: 40 },
{ country: "Sweden", gold: 30 }];
export let data: Object[] = [
{ x: '2014', y: 111.1, y1: 76.9, y2: 66.1, y3: 34.1 },
{ x: '2015', y: 127.3, y1: 99.5, y2: 79.3, y3: 38.2 },
{ x: '2016', y: 143.4, y1: 121.7, y2: 91.3, y3: 44.0 },
{ x: '2017', y: 159.9, y1: 142.5, y2: 102.4, y3: 51.6 },
{ x: '2018', y: 175.4, y1: 166.7, y2: 112.9, y3: 61.9 },
{ x: '2019', y: 189.0, y1: 182.9, y2: 122.4, y3: 71.5 },
{ x: '2020', y: 202.7, y1: 197.3, y2: 120.9, y3: 82.0 }
];
export let rangeData: Object[] = [
{ x: 'Jan', low: 0.7, high: 6.1 }, { x: 'Feb', low: 1.3, high: 6.3 }, { x: 'Mar', low: 1.9, high: 8.5 },
{ x: 'Apr', low: 3.1, high: 10.8 }, { x: 'May', low: 5.7, high: 14.40 }, { x: 'Jun', low: 8.4, high: 16.90 },
{ x: 'Jul', low: 10.6,high: 19.20 }, { x: 'Aug', low: 10.5,high: 18.9 }, { x: 'Sep', low: 8.5, high: 16.1 },
{ x: 'Oct', low: 6.0, high: 12.5 }, { x: 'Nov', low: 1.5, high: 6.9 }, { x: 'Dec', low: 5.1, high: 12.1 }];
export let radarData: Object[] = [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 },
{ x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }];
Empty points
Data points with null
or undefined
values are considered empty. Empty data points are ignored and not plotted on the chart.
Mode
Use the mode
property to define how empty or missing data points are handled in the series. The default mode for empty points is Gap
.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { radarData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Line' [emptyPointSettings]='emptyPointSettings'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
public emptyPointSettings?: Object;
ngOnInit(): void {
this.data = radarData;
this.primaryXAxis = {
title: 'Year', startAngle: 90,
minimum: 2004, maximum: 2012, interval: 1
};
this.title = 'Efficiency of oil-fired power production';
this.emptyPointSettings = {
mode: 'Zero'
}
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let radarData: Object[] = [
{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: null },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Fill
Use the fill
property to customize the fill color of empty points in the series.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { radarData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Line' [marker]='marker' [emptyPointSettings]='emptyPointSettings'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
public emptyPointSettings?: Object;
public marker?: Object;
ngOnInit(): void {
this.data = radarData;
this.primaryXAxis = {
title: 'Year', startAngle: 90,
minimum: 2004, maximum: 2012, interval: 1
};
this.marker = { visible: true};
this.title = 'Efficiency of oil-fired power production';
this.emptyPointSettings = {
mode: 'Zero', fill: 'red'
}
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let radarData: Object[] = [
{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: null },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Border
Use the border
property to customize the width and color of the border for empty points.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { radarData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Line' [marker]='marker' [emptyPointSettings]='emptyPointSettings'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
public emptyPointSettings?: Object;
public marker?: Object;
ngOnInit(): void {
this.data = radarData;
this.primaryXAxis = {
title: 'Year', startAngle: 90,
minimum: 2004, maximum: 2012, interval: 1
};
this.marker = {visible: true};
this.title = 'Efficiency of oil-fired power production';
this.emptyPointSettings = {
mode: 'Zero', fill: 'red', border: { width: 2, color: 'blue' }
}
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let radarData: Object[] = [
{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: null },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Events
Series render
The seriesRender
event allows you to customize series properties, such as data, fill, and name, before they are rendered on the chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { ISeriesRenderEventArgs } from '@syncfusion/ej2-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { radarData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' (seriesRender)='seriesRender($event)' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' drawType='Line'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
public emptyPointSettings?: Object;
ngOnInit(): void {
this.data = radarData;
this.primaryXAxis = {
title: 'Year', startAngle: 90,
minimum: 2004, maximum: 2012, interval: 1
};
this.title = 'Efficiency of oil-fired power production';
}
public seriesRender(args: ISeriesRenderEventArgs) {
args.fill = '#ff6347';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let radarData: Object[] = [{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];
Point render
The pointRender
event allows you to customize each data point before it is rendered on the chart.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ChartModule, ChartAllModule } from '@syncfusion/ej2-angular-charts'
import { IPointRenderEventArgs } from '@syncfusion/ej2-charts'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService} from '@syncfusion/ej2-angular-charts'
import { Component, OnInit } from '@angular/core';
import { radarData } from './datasource';
@Component({
imports: [
ChartModule, ButtonModule, ChartAllModule
],
providers: [ AreaSeriesService, LineSeriesService, ExportService, ColumnSeriesService, StackingColumnSeriesService, StackingAreaSeriesService, RangeColumnSeriesService, ScatterSeriesService, PolarSeriesService, CategoryService, RadarSeriesService, SplineSeriesService],
standalone: true,
selector: 'app-container',
template: ` <ejs-chart id='chartcontainer' (pointRender)='pointRender($event)' [primaryXAxis]='primaryXAxis'
[title]='title' >
<e-series-collection>
<e-series [dataSource]='data' type='Polar' xName='x' yName='y' [marker]='marker' drawType='Line'> </e-series>
</e-series-collection>
</ejs-chart>`
})
export class AppComponent implements OnInit {
public primaryXAxis?: Object;
public title?: string;
public primaryYAxis?: Object;
public data?: Object[];
public emptyPointSettings?: Object;
public marker?: object;
ngOnInit(): void {
this.data = radarData;
this.primaryXAxis = {
title: 'Year', startAngle: 90,
minimum: 2004, maximum: 2012, interval: 1
};
this.title = 'Efficiency of oil-fired power production';
this.marker = {visible: true};
}
public pointRender(args: IPointRenderEventArgs) {
args.fill = '#ff6347';
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
export let radarData: Object[] = [{ x: 2005, y: 28 },
{ x: 2006, y: 25 },
{ x: 2007, y: 26 },
{ x: 2008, y: 27 },
{ x: 2009, y: 32 },
{ x: 2010, y: 35 },
{ x: 2011, y: 30 }
];