score:3
**Tried following changes in
> app.module.ts
and its working fine !!**
import drilldown dependency as :
**import * as drilldown from 'highcharts/modules/drilldown.src.js'**
use providers in NgModule as :
providers: [
{provide: HIGHCHARTS_MODULES,
useFactory: () => [ drilldown]
}]
score:2
In your app.module.ts
import angular-charts and drilldown as below!
import { ChartModule, HIGHCHARTS_MODULES } from 'angular-highcharts';
import * as drilldown from 'highcharts/modules/drilldown.src';
imports: [ChartModule]
providers: [
{ provide: HIGHCHARTS_MODULES, useFactory: () => [more, exporting, drilldown] }
]
In your component.ts file initialize the chart the same way you did.
If it throws out an error Property 'type' is missing in type '{ name: string; data: ((string | number)[] | { name: string; y: number; drilldown: string; })[]; }' but required in type
then add type: undefined to the object. it will work as expected.
score:10
Use official npm highcharts
stackblitz demo
app.component.ts below
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { NgModule, OnInit, ViewChild, ElementRef, VERSION } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { Component } from '@angular/core';
import * as Highcharts from 'highcharts';
import Drilldown from 'highcharts/modules/drilldown';
Drilldown(Highcharts);
// Load the exporting module.
import Exporting from 'highcharts/modules/exporting';
// Initialize exporting module.
Exporting(Highcharts);
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent implements OnInit {
name = `Angular! v${VERSION.full}`;
@ViewChild("container", { read: ElementRef }) container: ElementRef;
constructor() {
}
ngOnInit() {
Highcharts.chart(this.container.nativeElement, {
// Created pie chart using Highchart
chart: {
type: 'pie',
options3d: {
enabled: true,
alpha: 45
}
},
title: {
text: 'Contents using Pie chart'
},
subtitle: {
text: '3D donut in Highcharts'
},
plotOptions: {
pie: {
innerSize: 100,
depth: 45
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},
series: [{
name: 'Operating Systems',
data: [
{
name: 'Windows',
y: 88.19,
drilldown: 'windows-versions'
},
['MacOSX', 9.22],
['Linux', 1.58],
['Others', 1.01]
]
}],
drilldown: {
series: [{
name: 'Windows versions',
id: 'windows-versions',
data: [
['Win 7', 55.03],
['Win XP', 15.83],
['Win Vista', 3.59],
['Win 8', 7.56],
['Win 8.1', 6.18]
]
}]
}
})
}
}
Source: stackoverflow.com
Related Query
- Drill Down (Highcharts) not working in Angular 5
- Highcharts Line Chart Drill down not working properly
- Drill Down (Highcharts) not working with dynamic data in Angular
- HighCharts Drill down not working
- Angular HighCharts ParlimentChart is not working
- Angular Highcharts dynamic x-axis not working
- Angular Highcharts hideNoData not working dynamically
- Highcharts upgrade to 8.1.2 not working with Angular 8
- Angular Highcharts Radial Bar Chart not working as expected
- HighCharts angular not working with dynamic data from Angular service
- Angular 9 Highcharts - when using series of type pie with type gauge the innerSize of pie is not working
- Not able to go back to original state after drill down in highcharts
- DataGrouping not working on highcharts angular
- Highcharts.SVGRenderer not working properly with Drill Down
- Dynamically changing Highcharts Theme through Jquery code not working
- Highcharts Stacked column drill down not working?> How to set drill down series for my scenario?
- Highcharts yAxis max not working
- Highcharts - drill down to multiple series
- Resize highcharts using react-grid-layout not working
- Highcharts Pie Chart Drilldown not showing on third drill
- highcharts redraw and reflow not working
- Drill down function in highcharts in case of line charts
- DataLabels formatter not working in Highcharts Sankey Diagram
- Highcharts shared tooltip for line series and scatter plot not working
- Highcharts async drilldown (3 level) - drillup not working
- Highcharts drill down - x-Axis labels loss on drillup
- Color contrast setting on dataLabels style parameter using Highcharts 5 is not working on some colors
- JavaScript code inside TypeScript file .ts not working
- Highcharts - update column graph with setData() not working
- using angular directive to draw highchart pie chart but when i am using it in success function it is not working
More Query from same tag
- Highcharts columnrange remove spacing from data in other categories
- Dynamic Labels for X axis in HighCharts
- Retrieve missing column Values
- Highcharts : Shared Tooltip for non-matching x values
- ReactDOM.render into a <div> does not immediately produce HTML
- yAxis resizer to change svgrenderer position also highcharts
- Displaying Stack name as legend key
- how to view graph based on date selection using highcharts
- Disabling a slice for a Highcharts pie chart when creating the chart
- What is a better option to use django-highcharts package to render charts in template or regular ugly rendering in django?
- Plotting data using higcharts in flask web application
- Hiding legend item box when using check box in Highcharts
- addSeriesAsDrilldown not working
- Reading uploaded csv file in highcharts
- Highcharts exceeding width of parent on Chrome only
- Plotting multiple series in single Highcharts plot from JSON
- How to hyperlink bar graph in highcharts
- Why am I seeing two different point types in Highcharts?
- R Highcharter: tooltip customization
- Network diagram meets Sankey chart
- Highcharts : how to display only days on xaxis?
- Highchart type : X-Range no space between two data sets
- Displaying highchart columnrange charting xAxis, yAxis and series
- SyntaxError: JSON.parse: expected property name or '}' while using highcharts
- how to make specific labels outside gauge chart
- Issue loading JSON in Highstock
- HighStock 2 panes with different php queries
- HighChart: y axis categories are pushed off chart area, don't fit
- how to create a horizontal video viewing "heatmap" using Highcharts
- Highcharts - stop Y axis value change on redraw