Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/bazel-out

# dependencies
/node_modules
node_modules

# profiling files
chrome-profiler-events*.json
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@angular/platform-browser": "~12.0.3",
"@angular/platform-browser-dynamic": "~12.0.3",
"@angular/router": "~12.0.3",
"angular-highcharts": "file:dist/angular-highcharts",
"highcharts": "^9.1.1",
"rxjs": "~7.1.0",
"tslib": "^2.2.0",
Expand Down
6 changes: 3 additions & 3 deletions projects/angular-highcharts/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"entryFile": "src/public-api.ts",
"umdModuleIds": {
"highcharts": "Highcharts",
"highcharts/highmaps": "Highmaps",
"highcharts/highstock": "Highstock",
"highcharts/highcharts-gantt": "HighchartsGantt"
"highcharts/modules/map.src": "Highmaps",
"highcharts/modules/stock.src": "Highstock",
"highcharts/modules/gantt.src": "HighchartsGantt"
}
}
}
16 changes: 9 additions & 7 deletions projects/angular-highcharts/src/lib/highcharts-gantt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ElementRef } from '@angular/core';
import * as Highcharts from 'highcharts/highcharts-gantt';
import { Chart, Options } from 'highcharts/highcharts.src';
import { Highcharts } from 'highcharts/modules/gantt.src';
import { AsyncSubject, Observable } from 'rxjs';

/**
Expand All @@ -11,16 +12,17 @@ import { AsyncSubject, Observable } from 'rxjs';
* https://github.com/cebor/angular-highcharts/blob/master/LICENSE
*/
export class HighchartsGantt {
private refSubject: AsyncSubject<Highcharts.Chart> = new AsyncSubject();
ref$: Observable<Highcharts.Chart> = this.refSubject.asObservable();
ref: Highcharts.Chart;
private refSubject: AsyncSubject<Chart> = new AsyncSubject();
ref$: Observable<Chart> = this.refSubject.asObservable();
ref: Chart;

constructor(private options: Highcharts.Options = { series: [] }) {}
constructor(private options: Options = { series: [] }) {}

init(el: ElementRef): void {
if (!this.ref) {
Highcharts.ganttChart(el.nativeElement, this.options, chart => {
if (!this.ref) { // TODO: workaround for doubled callbacks on exporting charts: issue #238
Highcharts.ganttChart(el.nativeElement, this.options, (chart) => {
if (!this.ref) {
// TODO: workaround for doubled callbacks on exporting charts: issue #238
this.refSubject.next(chart);
this.ref = chart;
this.refSubject.complete();
Expand Down
17 changes: 9 additions & 8 deletions projects/angular-highcharts/src/lib/mapchart.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ElementRef } from '@angular/core';
// import * as Highcharts from 'highcharts';
import * as Highmaps from 'highcharts/highmaps';
import { Chart, Options } from 'highcharts/highcharts.src';
import { Highcharts } from 'highcharts/modules/map.src';
import { AsyncSubject, Observable } from 'rxjs';

/**
Expand All @@ -12,16 +12,17 @@ import { AsyncSubject, Observable } from 'rxjs';
* https://github.com/cebor/angular-highcharts/blob/master/LICENSE
*/
export class MapChart {
private refSubject: AsyncSubject<Highmaps.Chart> = new AsyncSubject();
ref$: Observable<Highmaps.Chart> = this.refSubject.asObservable();
ref: Highmaps.Chart;
private refSubject: AsyncSubject<Chart> = new AsyncSubject();
ref$: Observable<Chart> = this.refSubject.asObservable();
ref: Chart;

constructor(private options: Highmaps.Options = { series: [] }) {}
constructor(private options: Options = { series: [] }) {}

init(el: ElementRef): void {
if (!this.ref) {
Highmaps.mapChart(el.nativeElement, this.options, chart => {
if (!this.ref) { // TODO: workaround for doubled callbacks on exporting charts: issue #238
Highcharts.mapChart(el.nativeElement, this.options, (chart) => {
if (!this.ref) {
// TODO: workaround for doubled callbacks on exporting charts: issue #238
this.refSubject.next(chart);
this.ref = chart;
this.refSubject.complete();
Expand Down
18 changes: 9 additions & 9 deletions projects/angular-highcharts/src/lib/stockchart.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { ElementRef } from '@angular/core';
//import * as Highcharts from 'highcharts';
import * as Highstock from 'highcharts/highstock';
import { Chart, Options } from 'highcharts/highcharts.src';
import { Highcharts } from 'highcharts/modules/stock.src';
import { AsyncSubject, Observable } from 'rxjs';


/**
* @license
* Copyright Felix Itzenplitz. All Rights Reserved.
Expand All @@ -16,15 +15,16 @@ import { AsyncSubject, Observable } from 'rxjs';
* @author Timothy A. Perez (contributor)
*/
export class StockChart {
private refSubject: AsyncSubject<Highstock.Chart> = new AsyncSubject();
ref$: Observable<Highstock.Chart> = this.refSubject.asObservable();
ref: Highstock.Chart;
constructor(private options: Highstock.Options = { series: [] }) {}
private refSubject: AsyncSubject<Chart> = new AsyncSubject();
ref$: Observable<Chart> = this.refSubject.asObservable();
ref: Chart;
constructor(private options: Options = { series: [] }) {}

init(el: ElementRef): void {
if (!this.ref) {
Highstock.stockChart(el.nativeElement, this.options, chart => {
if (!this.ref) { // TODO: workaround for doubled callbacks on exporting charts: issue #238
Highcharts.stockChart(el.nativeElement, this.options, (chart) => {
if (!this.ref) {
// TODO: workaround for doubled callbacks on exporting charts: issue #238
this.refSubject.next(chart);
this.ref = chart;
this.refSubject.complete();
Expand Down