3D Column Interactive Chart in Angular using HighChart

In this article, we saw how to draw 3d Column Interactive charts in angular using HighChart. In the last article, we saw a 3D Cylindrical Column chart in HighChart. In this article, we can rotate(Interactive) the column chart.
For drawing the chart First, we need to install High chart node modules in our application.

npm install highcharts --save
npm install highcharts-angular --save

After installing module lets add a module in our app.module.ts file.

import { HighchartsChartModule } from 'highcharts-angular';
imports:      [ ..., HighchartsChartModule],

After adding a module in the app.module file we can use it in our component to draw the chart. Let’s create app.component.ts file and add import highchat module using “import * as Highcharts from ‘highcharts’;” then assign options and values to the chart in this chart we need to chart type as “column” and adding series data we need to pass the browser name and percentage in json format to draw the data. In last article we show for 3D chart option enable we need to import “highcharts-3d” in our component. How to import “highcharts-3d” modules display in below code.

import highcharts3D from 'highcharts/highcharts-3d';

We need 3 parameters(alpha,beta,depth) to chnage the chart interactive chart.
Below is the full code for component and the html files.

import { Component, VERSION ,OnInit } from '@angular/core';
import * as Highcharts from 'highcharts';

declare var require: any;
const More = require('highcharts/highcharts-more');

import Histogram from 'highcharts/modules/histogram-bellcurve';

import highcharts3D from 'highcharts/highcharts-3d';

import Cylinder from 'highcharts/modules/cylinder';

const Exporting = require('highcharts/modules/exporting');

const ExportData = require('highcharts/modules/export-data');

const Accessibility = require('highcharts/modules/accessibility');
import * as newdata from './data';

  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
export class AppComponent  implements OnInit{

  public activity;
  public xData;
  public label;

  public alpha:number;
  public beta:number;
  public depth:number;
  constructor() {

  this.alpha = 15;
  this.beta = 15;
  this.depth = 50;

    this.options = {
    chart: {
        renderTo: 'container',
        type: 'column',
        options3d: {
            enabled: true,
            alpha: this.alpha,
            beta: this.beta,
            depth: this.depth,
            viewDistance: 25
    title: {
        text: 'Chart rotation demo'
    subtitle: {
        text: 'Test options by dragging the sliders below'
    plotOptions: {
        column: {
            depth: 25
    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]


    Highcharts.chart('container', this.options);


    if(type == 'alpha'){
       this.options.chart.options3d.alpha = val;
    if(type == 'beta'){
       this.options.chart.options3d.beta = val;
    if(type == 'depth'){
       this.options.chart.options3d.depth = val;
     Highcharts.chart('container', this.options);

<h1 style="text-align:center">3D Interactive Chart in Angular</h1>
<div class="form-inline">
  <label for="email">Alpha:</label>
  <input type="number" class="form-control" [(ngModel)]="alpha" (ngModelChange)="onChange($event,'alpha')">
  <label for="pwd">Beta:</label>
  <input type="number" class="form-control" [(ngModel)]="beta" (ngModelChange)="onChange($event,'beta')">
   <label for="pwd">Depth:</label>
  <input type="number" class="form-control" [(ngModel)]="depth" (ngModelChange)="onChange($event,'depth')">
<div id="container"></div>

Below is the full embeded code for the 3D Column Interactive chart using Highchart you can easily used in your application.

Spread the love