I am having an issue integrating DrillDown from Highcharts with Angular 19 - Stack Overflow

I am integrating DrillDown from Highcharts into my angular 19 application.Here is the error I get from

I am integrating DrillDown from Highcharts into my angular 19 application.

Here is the error I get from the browser console: ERROR TypeError: Ye(...) is not a function

Here are the libraries I install:

1. "highcharts": "^12.1.2".
2. "highcharts-angular": "^4.0.1"

What I did on my drilldown-chartponent.ts:

import {Component, OnInit} from '@angular/core';
import * as Highcharts from 'highcharts';
import Drilldown from 'highcharts/modules/drilldown';
import { HighchartsChartModule } from "highcharts-angular";
// Initialize the drilldown module
Drilldown(Highcharts);

@Component({
  selector: 'app-drilldown-chart',
  imports: [HighchartsChartModule],
  templateUrl: './drilldown-chartponent.html',
  styleUrl: './drilldown-chartponent.scss'
})
export class DrilldownChartComponent implements OnInit {

    
    ngOnInit(): void {
        this.loadChart()
    }

  Highcharts: typeof Highcharts = Highcharts;
  chartOptions: Highcharts.Options = {};

    loadChart(): void {
        this.chartOptions = {
            // In here is my chart details
        };
    }
}

And this in my drilldown-chartponent.html:

<highcharts-chart
    [Highcharts]="Highcharts"
    [options]="chartOptions"
    style="width: 100%; height: 400px; display: block;">
</highcharts-chart>

I have try using the Pie and Line charts can it works as expected.

But when I introduce this Drilldown(Highcharts); the page no longer loads.

I am integrating DrillDown from Highcharts into my angular 19 application.

Here is the error I get from the browser console: ERROR TypeError: Ye(...) is not a function

Here are the libraries I install:

1. "highcharts": "^12.1.2".
2. "highcharts-angular": "^4.0.1"

What I did on my drilldown-chartponent.ts:

import {Component, OnInit} from '@angular/core';
import * as Highcharts from 'highcharts';
import Drilldown from 'highcharts/modules/drilldown';
import { HighchartsChartModule } from "highcharts-angular";
// Initialize the drilldown module
Drilldown(Highcharts);

@Component({
  selector: 'app-drilldown-chart',
  imports: [HighchartsChartModule],
  templateUrl: './drilldown-chartponent.html',
  styleUrl: './drilldown-chartponent.scss'
})
export class DrilldownChartComponent implements OnInit {

    
    ngOnInit(): void {
        this.loadChart()
    }

  Highcharts: typeof Highcharts = Highcharts;
  chartOptions: Highcharts.Options = {};

    loadChart(): void {
        this.chartOptions = {
            // In here is my chart details
        };
    }
}

And this in my drilldown-chartponent.html:

<highcharts-chart
    [Highcharts]="Highcharts"
    [options]="chartOptions"
    style="width: 100%; height: 400px; display: block;">
</highcharts-chart>

I have try using the Pie and Line charts can it works as expected.

But when I introduce this Drilldown(Highcharts); the page no longer loads.

Share Improve this question asked Feb 23 at 9:37 Anana AristotleAnana Aristotle 11 silver badge1 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

From the version 12, HighCharts no longer work with the module factory. Hence you need to do the migration for importing the module(s) as below:

import * as Highcharts from 'highcharts';
import 'highcharts/modules/drilldown';

Demo @ StackBlitz

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745159008a4614298.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信