angular-highcharts icon indicating copy to clipboard operation
angular-highcharts copied to clipboard

dependency-wheel

Open ben33880 opened this issue 5 years ago • 6 comments

i've a problem with dependency-wheel chart, i cant load module because file "dependency-wheel.src.d.ts" not exists in highcharts/modules.

Is there a workaround ?

ben33880 avatar May 19 '19 10:05 ben33880

Did you find a workaround for this?

jamespwilson avatar Jun 05 '19 03:06 jamespwilson

Yes...

1- copy paste sankey files from highcharts/module in your project. 2- rename them with dependency-wheel instead of sankey 3- in module import : import * as sankey from 'highcharts/modules/sankey.src'; import * as wheel from './dependency-wheel.src'; import * as more from 'highcharts/highcharts-more.src'; import * as exporting from 'highcharts/modules/exporting.src'; 4- provider : providers: [ { provide: HIGHCHARTS_MODULES, useFactory: () => [more, exporting, sankey, wheel] }

ben33880 avatar Jun 05 '19 06:06 ben33880

Hello, I am also having some problems to display my dependency-wheel chart. I have already tried what you did but it didn't work for me. I am having the following error:

[ng] ERROR in src/app/tab1/tab1.page.ts(87,4): error TS2322: Type 'string' is not assignable to type '"item" | "area" | "map" | "line" | "polygon" | "abands" | "ad" | "ao" | "apo" | "arearange" | "areaspline" | "areasplinerange" | "aroon" | "aroonoscillator" | "atr" | "bar" | "bb" | ... 79 more ... | "zigzag"'.

Code:

import { Component } from '@angular/core';
import * as Highcharts from 'highcharts';
import { NavController } from '@ionic/angular';
import * as sankey from 'highcharts/modules/sankey.src';
import * as wheel from 'highcharts/modules/dependency-wheel.src';
wheel(Highcharts);
import * as more from 'highcharts-more';
import * as exporting from 'highcharts/modules/exporting.src';
import { ChartModule, HIGHCHARTS_MODULES } from 'angular-highcharts';

@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss'],
  providers: [
    { provide: HIGHCHARTS_MODULES, useFactory: () => [more, exporting, sankey, wheel] }
  ]
})


export class Tab1Page {

  constructor() {}
  
  ionViewDidLoad() {
	  
	Highcharts.chart('container', {

		title: {
			text: 'Déplacements entre pays'
		},

		series: [{
			keys: ['from', 'to', 'weight'],
			data: [
				['Brazil', 'Portugal', 5],
				['Brazil', 'France', 1],
				['Brazil', 'Spain', 1],
				['Brazil', 'England', 1],
				['Canada', 'Portugal', 1],
				['Canada', 'France', 5],
			],
			name: 'dependency-wheel',
			type: 'dependencywheel',
			dataLabels: {
				color: '#333',
				textPath: {
					enabled: true,
					attributes: {
						dy: 5
					}
				},
				distance: 10
			},
			size: '95%'
		}]
	});
	}
}

npm: 6.9.0 ionic: 5.0.1

Could you help me?

gabrielperisse avatar Jun 05 '19 14:06 gabrielperisse

Look at : https://github.com/pipiche38/Domoticz-Zigate-UI/tree/master/src/app/network

Composent detail-topology.component.ts

ben33880 avatar Jun 05 '19 14:06 ben33880

I'm trying to load the dependency-wheel module in the same was as loading other modules (such as item-series or pattern-fill which work fine) and I get the following error:

dependency-wheel.js:11 Uncaught TypeError: Cannot read property 'prototype' of undefined
    at dependency-wheel.js:11
    at d (dependency-wheel.js:10)
    at dependency-wheel.js:10
    at app.module.ts:415
    at Array.forEach (<anonymous>)
    at Module../src/app/app.module.ts (app.module.ts:415)
    at __webpack_require__ (bootstrap:79)
    at Module../src/main.ts (main.ts:1)
    at __webpack_require__ (bootstrap:79)
    at Object.0 (main.ts:10)

Is this the same cause as described here? Is there a fix in the works?

wlievens avatar May 14 '20 07:05 wlievens

Ah I found the issue: I have load Sankey before I load the Dependency Wheel module!

wlievens avatar May 14 '20 08:05 wlievens