How can I help you?
Getting started with Angular 3D Chart component
18 Feb 202624 minutes to read
This section explains the steps required to create a simple Angular 3D Chart and demonstrates the basic usage of the 3D Chart component in an Angular environment.
Note: This guide supports Angular 21 and other recent Angular versions. For detailed compatibility with other Angular versions, please refer to the Angular version support matrix. Starting from Angular 19, standalone components are the default, and this guide reflects that architecture.
Ready to streamline your Syncfusion® Angular development? Discover the full potential of Syncfusion® Angular components with Syncfusion® AI Coding Assistant. Effortlessly integrate, configure, and enhance your projects with intelligent, context-aware code suggestions, streamlined setups, and real-time insights—all seamlessly integrated into your preferred AI-powered IDEs like VS Code, Cursor, Syncfusion® CodeStudio and more. Explore Syncfusion® AI Coding Assistant
Prerequisites
Ensure your development environment meets the System Requirements for Syncfusion® Angular UI Components.
Setup Angular environment
A straightforward approach to begin with Angular is to create a new application using the Angular CLI. Install Angular CLI globally with the following command:
npm install -g @angular/cliAngular 21 Standalone Architecture: Standalone components are the default in Angular 21. This guide uses the modern standalone architecture. If you need more information about the standalone architecture, refer to the Standalone Guide.
Installing a specific version
To install a particular version of Angular CLI, use:
npm install -g @angular/[email protected]Create an Angular application
With Angular CLI installed, execute this command to generate a new application:
ng new syncfusion-angular-app- This command will prompt you to configure settings like enabling Angular routing and choosing a stylesheet format.
? Which stylesheet format would you like to use? (Use arrow keys)
> CSS [ https://developer.mozilla.org/docs/Web/CSS ]
Sass (SCSS) [ https://sass-lang.com/documentation/syntax#scss ]
Sass (Indented) [ https://sass-lang.com/documentation/syntax#the-indented-syntax ]
Less [ http://lesscss.org ]- By default, a CSS-based application is created. Use SCSS if required:
ng new syncfusion-angular-app --style=scss- During project setup, when prompted for the Server-side rendering (SSR) option, choose the appropriate configuration.

- Select the required AI tool or ‘none’ if you do not need any AI tool.

- Navigate to your newly created application directory:
cd syncfusion-angular-appNote: In Angular 19 and below, the CLI generates files like
app.component.ts,app.component.html,app.component.css, etc. In Angular 20+, the CLI generates a simpler structure withsrc/app/app.ts,app.html, andapp.css(no.component.suffixes).
Installing Syncfusion® 3D Chart package
Syncfusion®’s Angular component packages are available on npmjs.com. To use Syncfusion® Angular components, install the necessary package.
This guide uses the Angular 3D Chart component for demonstration. Add the Angular 3D Chart component with:
ng add @syncfusion/ej2-angular-chartsThe above command will perform the following configurations:
- Add the
@syncfusion/ej2-angular-chartspackage and peer dependencies to yourpackage.json. - Import the 3D Chart component in your application.
For more details on version compatibility, refer to the Version Compatibility section.
Syncfusion® offers two package structures for Angular components:
- Ivy library distribution package format
- Angular compatibility compiler (ngcc), which is Angular’s legacy compilation pipeline.
Ivy library distribution package
Syncfusion®’s latest Angular packages are provided as Ivy-compatible and suited for Angular 12 and above. To install the package, execute:
ng add @syncfusion/ej2-angular-chartsAngular compatibility compiled package(ngcc)
For applications not compiled with Ivy, use the ngcc tagged packages:
The ngcc packages are still compatible with Angular CLI versions 15 and below. However, they may generate warnings suggesting the use of Ivy compiled packages. Starting from Angular 16, support for the ngcc package has been completely removed. If you have further questions regarding ngcc compatibility, please refer to the following FAQ.
npm add @syncfusion/[email protected]Add 3D Chart component
Modify the template in app.component.ts file to render the 3D Charts component [src/app/app.component.ts].
import { Component, ViewEncapsulation } from '@angular/core';
import { Chart3DAllModule } from '@syncfusion/ej2-angular-charts';
@Component({
imports: [Chart3DAllModule],
standalone: true,
selector: 'app-container',
// specifies the template string for the 3D Charts component
template: `<ejs-chart3d id='chart-container'></ejs-chart3d>`,
encapsulation: ViewEncapsulation.None
})
export class AppComponent { }Now use the app-container selector in the index.html file instead of the default one.
<app-container></app-container>Use the ng serve command to run the application in the browser.
ng serveThe below example shows a basic 3D Chart.
import { Chart3DModule } from '@syncfusion/ej2-angular-charts';
import { Component } from '@angular/core';
@Component({
imports: [Chart3DModule],
standalone: true,
selector: 'app-container',
// specifies the template string for the 3D Chart component
template: `<ejs-chart3d id='chart-container'></ejs-chart3d>`
})
export class AppComponent {
}import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));Module injection
3D Chart components are segregated into individual feature-wise modules. In order to use a particular feature, you need to inject its feature service in the app.component.ts. In the current application, we are going to modify the above basic 3D Chart to visualize sales data for a particular year. For this application we are going to use column series, tooltip, data label, category axis and legend feature of the 3D Chart. Please find relevant feature service name and description as follows.
-
ColumnSeries3DService- Inject this provider to use column series. -
Legend3DService- Inject this provider to use legend feature. -
Tooltip3DService- Inject this provider to use tooltip feature. -
DataLabel3DService- Inject this provider to use datalabel feature. -
Category3DService- Inject this provider to use category feature.
Now import the above-mentioned modules from the chart package and inject them into the Chart3D component through the provider section.
import { Chart3DModule, ColumnSeries3DService, Legend3DService, Tooltip3DService, DataLabel3DService, Category3DService } from '@syncfusion/ej2-angular-charts';
import { Component } from '@angular/core';
@Component({
imports: [Chart3DModule],
standalone: true,
providers: [ ColumnSeries3DService, Legend3DService, Tooltip3DService, DataLabel3DService, Category3DService ]
})Populate chart with data
This section explains how to plot the following JSON data to the 3D Chart.
export class AppComponent implements OnInit {
public chartData: Object[];
ngOnInit(): void {
// Data for chart series
this.chartData = [
{ x: 'Tesla', y: 137429 },
{ x: 'Aion', y: 80308 },
{ x: 'Wuling', y: 76418 },
{ x: 'Changan', y: 52849 },
{ x: 'Geely', y: 47234 },
{ x: 'Nio', y: 31041 },
{ x: 'Neta', y: 22449 },
{ x: 'BMW', y: 18733 }
];
}
}Add series to the 3D Chart in the component template using the <e-chart3d-series-collection> and <e-chart3d-series> child directives. Map the JSON fields x and y to the series xName and yName properties, and set the JSON array as the dataSource property.
Since the JSON contains category data, set the valueType for the horizontal axis (primaryXAxis) to Category. By default, the axis valueType is Numeric.
import { Chart3DAllModule } from '@syncfusion/ej2-angular-charts';
import { Component, OnInit } from '@angular/core';
@Component({
imports: [Chart3DAllModule],
standalone: true,
selector: 'app-container',
template: `<ejs-chart3d style='display:block;' align='center' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
rotation=7 tilt=10 depth=100 [enableRotation]='enableRotation'>
<e-chart3d-series-collection>
<e-chart3d-series [dataSource]='dataSource' type='Column' xName='x' yName='y'>
</e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>`
})
export class AppComponent implements OnInit {
public dataSource?: Object[];
public primaryXAxis?: Object;
public primaryYAxis?: Object;
public enableRotation?: boolean;
ngOnInit(): void {
this.dataSource = [
{ x: 'Tesla', y: 137429 }, { x: 'Aion', y: 80308 },
{ x: 'Wuling', y: 76418 }, { x: 'Changan', y: 52849 },
{ x: 'Geely', y: 47234 }, { x: 'Nio', y: 31041 },
{ x: 'Neta', y: 22449 }, { x: 'BMW', y: 18733 }];
this.primaryXAxis = {
valueType: 'Category',
labelRotation: -45,
labelPlacement: 'BetweenTicks'
};
this.primaryYAxis = {
maximum: 150000,
interval: 50000
};
this.enableRotation = true;
}
}import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));Add 3D Chart title
You can add a title using the title property to the 3D Chart to provide quick information to the user about the data plotted in the 3D Chart.
import { Chart3DAllModule } from '@syncfusion/ej2-angular-charts';
import { Component } from '@angular/core';
@Component({
imports: [Chart3DAllModule],
standalone: true,
selector: 'app-container',
// specifies the template string for the Chart component
template: `<ejs-chart3d style='display:block;' align='center' [title]='title' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
rotation=7 tilt=10 depth=100 [enableRotation]='enableRotation'>
<e-chart3d-series-collection>
<e-chart3d-series [dataSource]='dataSource' type='Column' xName='x' yName='y'>
</e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>`
})
export class AppComponent {
public dataSource?: Object[];
public primaryXAxis?: Object;
public primaryYAxis?: Object;
public enableRotation?: boolean;
public title?: string;
ngOnInit(): void {
this.dataSource = [
{ x: 'Tesla', y: 137429 }, { x: 'Aion', y: 80308 },
{ x: 'Wuling', y: 76418 }, { x: 'Changan', y: 52849 },
{ x: 'Geely', y: 47234 }, { x: 'Nio', y: 31041 },
{ x: 'Neta', y: 22449 }, { x: 'BMW', y: 18733 }];
this.primaryXAxis = {
valueType: 'Category',
labelRotation: -45,
labelPlacement: 'BetweenTicks'
};
this.primaryYAxis = {
maximum: 150000,
interval: 50000
};
this.enableRotation = true;
this.title = 'Top Selling Electric Cars in China';
}
}import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));Enable legend
You can use legend for the 3D Chart by setting the visible property to true in legendSettings object and by injecting the Legend3DService into the component’s providers array.
import { Chart3DAllModule } from '@syncfusion/ej2-angular-charts';
import { Component, OnInit } from '@angular/core';
@Component({
imports: [Chart3DAllModule],
standalone: true,
selector: 'app-container',
template: `<ejs-chart3d style='display:block;' align='center' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
rotation=7 tilt=10 depth=100 [legendSettings]="legendSettings" [enableRotation]='enableRotation' [title]='title'>
<e-chart3d-series-collection>
<e-chart3d-series [dataSource]='dataSource' type='Column' xName='x' yName='y' name='Sales'>
</e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>`
})
export class AppComponent implements OnInit {
public dataSource?: Object[];
public primaryXAxis?: Object;
public primaryYAxis?: Object;
public enableRotation?: boolean;
public title?: string;
public legendSettings?: Object;
ngOnInit(): void {
this.dataSource = [
{ x: 'Tesla', y: 137429 }, { x: 'Aion', y: 80308 },
{ x: 'Wuling', y: 76418 }, { x: 'Changan', y: 52849 },
{ x: 'Geely', y: 47234 }, { x: 'Nio', y: 31041 },
{ x: 'Neta', y: 22449 }, { x: 'BMW', y: 18733 }];
this.primaryXAxis = {
valueType: 'Category',
labelRotation: -45,
labelPlacement: 'BetweenTicks'
};
this.primaryYAxis = {
maximum: 150000,
interval: 50000
};
this.enableRotation = true;
this.title = 'Top Selling Electric Cars in China';
this.legendSettings = { visible: true };
}
}import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));Add data label
You can add data labels to improve the readability of the 3D Chart. This can be achieved by setting the visible property to true in the dataLabel object and by injecting DataLabel3DService into the component’s providers array. Now, the data labels are arranged smartly based on series.
import { Chart3DAllModule } from '@syncfusion/ej2-angular-charts';
import { Component, OnInit } from '@angular/core';
@Component({
imports: [Chart3DAllModule],
standalone: true,
selector: 'app-container',
template: `<ejs-chart3d style='display:block;' align='center' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
rotation=7 tilt=10 depth=100 [enableRotation]='enableRotation' [title]='title'>
<e-chart3d-series-collection>
<e-chart3d-series [dataSource]='dataSource' [dataLabel]="datalabel" type='Column' xName='x' yName='y' name='Sales'>
</e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>`
})
export class AppComponent implements OnInit {
public dataSource?: Object[];
public primaryXAxis?: Object;
public primaryYAxis?: Object;
public enableRotation?: boolean;
public title?: string;
public legendSettings?: Object;
public datalabel?: Object;
ngOnInit(): void {
this.dataSource = [
{ x: 'Tesla', y: 137429 }, { x: 'Aion', y: 80308 },
{ x: 'Wuling', y: 76418 }, { x: 'Changan', y: 52849 },
{ x: 'Geely', y: 47234 }, { x: 'Nio', y: 31041 },
{ x: 'Neta', y: 22449 }, { x: 'BMW', y: 18733 }];
this.primaryXAxis = {
valueType: 'Category',
labelRotation: -45,
labelPlacement: 'BetweenTicks'
};
this.primaryYAxis = {
maximum: 150000,
interval: 50000
};
this.enableRotation = true;
this.title = 'Top Selling Electric Cars in China';
this.legendSettings = { visible: true };
this.datalabel = {
visible: true
};
}
}import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));Enable tooltip
The tooltip is useful when you cannot display information by using the data labels due to space constraints. You can enable tooltip by setting the enable property as true in tooltip object and by injecting Tooltip3DService into the component’s providers array.
import { Chart3DAllModule } from '@syncfusion/ej2-angular-charts';
import { Component, OnInit } from '@angular/core';
@Component({
imports: [Chart3DAllModule],
standalone: true,
selector: 'app-container',
template: `<ejs-chart3d style='display:block;' align='center' [tooltip]="tooltip" [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
rotation=7 tilt=10 depth=100 [enableRotation]='enableRotation'>
<e-chart3d-series-collection>
<e-chart3d-series [dataSource]='dataSource' [dataLabel]="datalabel" type='Column' xName='x' yName='y' name='Sales'>
</e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>`
})
export class AppComponent implements OnInit {
public dataSource?: Object[];
public primaryXAxis?: Object;
public primaryYAxis?: Object;
public enableRotation?: boolean;
public title?: string;
public legendSettings?: Object;
public datalabel?: Object;
public tooltip?: Object;
ngOnInit(): void {
this.dataSource = [
{ x: 'Tesla', y: 137429 }, { x: 'Aion', y: 80308 },
{ x: 'Wuling', y: 76418 }, { x: 'Changan', y: 52849 },
{ x: 'Geely', y: 47234 }, { x: 'Nio', y: 31041 },
{ x: 'Neta', y: 22449 }, { x: 'BMW', y: 18733 }];
this.primaryXAxis = {
valueType: 'Category',
labelRotation: -45,
labelPlacement: 'BetweenTicks'
};
this.primaryYAxis = {
maximum: 150000,
interval: 50000
};
this.enableRotation = true;
this.title = 'Top Selling Electric Cars in China';
this.legendSettings = { visible: true };
this.datalabel = {
visible: true
};
this.tooltip = { enable: true };
}
}import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));You can refer to our Angular 3D Charts feature tour page for its groundbreaking feature representations. You can also explore our Angular 3D Charts example that shows various 3D Chart types and how to represent time-dependent data, showing trends in data at equal intervals.