Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drill down is not working for angular-highcharts #64

Closed
GauravNagpure opened this issue Sep 21, 2017 · 30 comments
Closed

Drill down is not working for angular-highcharts #64

GauravNagpure opened this issue Sep 21, 2017 · 30 comments

Comments

@GauravNagpure
Copy link

I was trying to use pie chart to pie chart drilldown, but it looks like it has used in highchart.js but not implemented in this package.

https://www.highcharts.com/demo/pie-drilldown
I am looking for exact same feature as given in above link.
Can you please help me with that ?
Thanks

@cebor
Copy link
Owner

cebor commented Sep 21, 2017

@GauravNagpure you have to loade some extra modules: see https://github.com/cebor/angular-highcharts#using-highcharts-modules

@cebor cebor closed this as completed Sep 21, 2017
@GauravNagpure
Copy link
Author

@cebor I have imported Highcharts and drilldown as instructed in https://github.com/cebor/angular-highcharts#using-highcharts-modules, like this,

import { Highcharts } from 'angular-highcharts';
import drilldown from 'highcharts/modules/drilldown.src.js';
drilldown(Highcharts)

after calling drilldown function getting following error.

Uncaught TypeError: Cannot read property 'noop' of undefined
    at drilldown.src.js:27
    at drilldown.src.js:1017

Highcharts object is seems to be undefined which is imported from 'angular-highcharts'.

@cebor cebor reopened this Sep 22, 2017
@gaurishrane
Copy link

I am also facing the same issue try with importing but not able to get the result.
Please anyone has a solution on this.

@Franky238
Copy link

Franky238 commented Oct 10, 2017

Same issue... Highcharts undefined also with heatmap.module.js

@Sathiesh-Cango
Copy link

Sathiesh-Cango commented Oct 16, 2017

@cebor I'm also facing the same issue which @GauravNagpure facing.

import { Highcharts } from 'angular-highcharts';
import drilldown from 'highcharts/modules/drilldown.src.js';
drilldown(Highcharts)

while executing the program drilldown function getting following error.

Uncaught TypeError: Cannot read property 'noop' of undefined
at drilldown.src.js:27
at drilldown.src.js:1017

Please help us to solve this issue as soon as. Thanks in advance

@Franky238
Copy link

@Sathiesh-Cango try my solution

import Highcharts from 'highcharts';
import drilldown from 'highcharts/modules/drilldown.src.js';
drilldown(Highcharts)

Because Highcharts is undefined from this library. Try to import it directly from highcharts library. (Be careful it is without {}

@Sathiesh-Cango
Copy link

Sathiesh-Cango commented Oct 16, 2017

Thanks @Franky238, drilldown function is working.
And I have one more doubt as how to import 3D charts

@Franky238
Copy link

Franky238 commented Oct 16, 2017

import highcharts3D from 'highcharts/js/highcharts-3d.src.js'

but i am not sure. Please let me know if it is working

@Sathiesh-Cango
Copy link

I'm also not able to load the area charts.
I used type: 'arearange',

@Sathiesh-Cango
Copy link

Sathiesh-Cango commented Oct 16, 2017

@Franky238 I imported this for 3d effect import highcharts3D from 'highcharts/js/highcharts-3d.src.js' in my component, but it is not working. Please help me...

@Franky238
Copy link

Franky238 commented Oct 16, 2017

so you need to call it like

highcharts3D(Highcharts);

@cebor
Copy link
Owner

cebor commented Oct 16, 2017

Hello, i recommend follwoing way to import the highcharts ref:

import * as Highcharts from 'highcharts';
import drilldown from 'highcharts/modules/drilldown.src.js';
drilldown(Highcharts)

I opened an issue @ rollup which i think is responsible for this. rollup/rollup#1675

@Franky238
Copy link

@cebor true story... tslint error because highcharts has no default export

@Sathiesh-Cango
Copy link

Sathiesh-Cango commented Oct 16, 2017

@Franky238 I tried like below
import drilldown from 'highcharts/modules/drilldown.src.js';
import highcharts3D from 'highcharts/js/highcharts-3d.src.js';
drilldown(Highcharts);
highcharts3D(Highcharts)

while executing I got an error as

DashboardComponent.html:8 ERROR TypeError: this.definition is not a function
at a.SVGRenderer. (http://localhost:4200/vendor.bundle.js:4281:22)
at Array.forEach ()
at a.each (http://localhost:4200/vendor.bundle.js:3680:325)
at a.SVGRenderer. (http://localhost:4200/vendor.bundle.js:4274:13)
at a.SVGRenderer.a.(anonymous function) [as init] (http://localhost:4200/vendor.bundle.js:3671:186)
at new a.SVGRenderer (http://localhost:4200/vendor.bundle.js:3713:378)
at a.Chart.getContainer (http://localhost:4200/vendor.bundle.js:3891:309)
at a.Chart. (http://localhost:4200/vendor.bundle.js:5499:21)
at a.Chart.a.(anonymous function) [as getContainer] (http://localhost:4200/vendor.bundle.js:3671:186)
at a.Chart.firstRender (http://localhost:4200/vendor.bundle.js:3905:431)

Please help

@Franky238
Copy link

@Sathiesh-Cango hard question. In my case it is working.

@Sathiesh-Cango
Copy link

Hi @Franky238 now 3D working. I imported as
import highcharts3D from 'highcharts/highcharts-3d.src.js';
'highcharts3D(Highcharts)`
Thanks for the initial Support

@Sathiesh-Cango
Copy link

I'm also not able to load the area charts.
I used type: 'arearange',

@GauravNagpure
Copy link
Author

import * as Highcharts from 'highcharts'; import drilldown from 'highcharts/modules/drilldown.src.js'; drilldown(Highcharts)
this code works for me. Thanks @cebor

@cebor
Copy link
Owner

cebor commented Oct 16, 2017

This is the "new way" to import Highchartsmodules: https://github.com/cebor/angular-highcharts/releases/tag/v4.0.0

@cebor cebor closed this as completed Oct 16, 2017
@Sathiesh-Cango
Copy link

Sathiesh-Cango commented Oct 16, 2017

@cebor I tried to import as per v4.0.0 and also I updated in package.json for angular-highcharts to ^4.0.0 but I get an error while importing as

node_modules/angular-highcharts/angular-highcharts"' has no exported member 'HighchartsModule'.

is there need to do any more configuration?
//app.module.ts
screenshot from 2017-10-16 17-54-53

//package.json
screenshot from 2017-10-16 18-02-03

@Franky238
Copy link

you need register provider... read readme file propertly

@NgModule({
  providers: [
    { provide: HIGHCHARTS_MODULES, useValue: [exporting] } // apply Highcharts Modules
  ]
})

@Sathiesh-Cango
Copy link

Sathiesh-Cango commented Oct 16, 2017

@Franky238 I did that too but importing itself occurring error. so providers also showing error

//registering in provider
screenshot from 2017-10-16 18-06-13

while trying to run ng serve

I'm getting an error as

/node_modules/angular-highcharts/chart.d.ts (1,1): Cannot find type definition file for 'highcharts'.

@cebor
Copy link
Owner

cebor commented Oct 16, 2017

@Sathiesh-Cango

rm -r node_modules && npm i

@Sathiesh-Cango
Copy link

@cebor I did the above command, the same error occurs.

@cebor
Copy link
Owner

cebor commented Oct 16, 2017

@Sathiesh-Cango try to update to 4.0.1 this should fix your issues

@Sathiesh-Cango
Copy link

@cebor I updated to 4.0.1
screenshot from 2017-10-16 19-05-59

Eventhough I'm facing problem while running the ng serve itself

node_modules/angular-highcharts/chart.d.ts (1,1): Cannot find type definition file for 'highcharts'.

@cebor
Copy link
Owner

cebor commented Oct 16, 2017

  1. npm i -D @types/highcharts
  2. There was an issue with AOT compiler. Try the following:
import { ChartModule, HIGHCHARTS_MODULES } from 'angular-highcharts';
import exporting from 'highcharts/modules/exporting.src.js';

export function highchartsModules() {
  // apply Highcharts Modules to this array
  return [ exporting ];
}

@NgModule({
  providers: [
    { provide: HIGHCHARTS_MODULES, useFactory: highchartsModules } // add as factory to your providers
  ]
})

@Sathiesh-Cango
Copy link

Sathiesh-Cango commented Oct 17, 2017

@cebor I tried with above guidelines, now I'm facing error while starting the ng serve as

screenshot from 2017-10-17 14-46-17

Still I can't able to import in app.module, it showing error

screenshot from 2017-10-17 15-02-23

@cebor
Copy link
Owner

cebor commented Oct 17, 2017

@Sathiesh-Cango for me this looks you are using 4.0.0 not 4.0.1.

Try to clean npm/yarn caches, remove node_modules and yarn.lock/package-lock.json.

@Sathiesh-Cango
Copy link

Sathiesh-Cango commented Oct 17, 2017

Thanks @cebor now the errors are solved but I don't know the difference of previous version and the current version because in component I'm importing import * as Highcharts from 'highcharts';. in v4.0.1 also
Similarly
import drilldown from 'highcharts/modules/drilldown.src.js';
import highcharts3D from 'highcharts/highcharts-3d.src.js';
drilldown(Highcharts);
highcharts3D(Highcharts);

So I don't know what is the benefits of it.

Any one can explain it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants