Skip to content

Commit

Permalink
Fixed bug multiple chart
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrathings committed Jan 14, 2017
1 parent 6a9d9eb commit 560837a
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 31 deletions.
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ If you are using nvd3 for angular2.RC take a look [ng2-nvd3](https://github.com/

This node use some dependency of [@types](https://github.com/DefinitelyTyped/DefinitelyTyped) :

- @types/nvd3
- @types/d3
- d3
- nvd3
- @types/nvd3@^1.8.33
- @types/d3@^3.5.35
- d3@^3.5.17
- nvd3@^1.8.5

Most of people get chart background turn into black, make sure to include `nvd3.css` via transpiler `webpack` or `systemjs` or what your transpiler.

Expand Down Expand Up @@ -145,10 +145,3 @@ you can set your callback:

you rock....!!!

## Change Log

### 1.0.1 (master)

- Angular2 - v2.4.1


2 changes: 1 addition & 1 deletion dist/angular2-nvd3/angular2-nvd3.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var angular2_nvd3_core_1 = require("./angular2-nvd3.core");
var NvD3Component = (function () {
function NvD3Component(el) {
this.el = el;
this.ngNvD3 = angular2_nvd3_core_1.Angular2NvD3.NgNvD3.getInstance(this.el);
this.ngNvD3 = new angular2_nvd3_core_1.Angular2NvD3.NgNvD3(this.el);
}
NvD3Component.prototype.ngOnChanges = function () {
this.ngNvD3.updateWithOptions(this.options, this.data);
Expand Down
2 changes: 0 additions & 2 deletions dist/angular2-nvd3/angular2-nvd3.core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ export declare namespace Angular2NvD3 {
private chart;
private svg;
private viewInitialize;
private static instance;
constructor(el: any);
static getInstance(el: any): NgNvD3;
isViewInitialize(value: boolean): void;
updateWithOptions(options: any, data: any): void;
private updateWithData(data, options);
Expand Down
6 changes: 0 additions & 6 deletions dist/angular2-nvd3/angular2-nvd3.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ var Angular2NvD3;
this.viewInitialize = false;
this.el = el;
}
NgNvD3.getInstance = function (el) {
if (!NgNvD3.instance) {
NgNvD3.instance = new NgNvD3(el);
}
return NgNvD3.instance;
};
NgNvD3.prototype.isViewInitialize = function (value) {
this.viewInitialize = value;
};
Expand Down
2 changes: 1 addition & 1 deletion dist/angular2-nvd3/angular2-nvd3.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var angular2_nvd3_core_1 = require("./angular2-nvd3.core");
var NvD3Directive = (function () {
function NvD3Directive(el) {
this.el = el;
this.ngNvD3 = angular2_nvd3_core_1.Angular2NvD3.NgNvD3.getInstance(this.el);
this.ngNvD3 = new angular2_nvd3_core_1.Angular2NvD3.NgNvD3(this.el);
}
NvD3Directive.prototype.ngOnChanges = function () {
this.ngNvD3.updateWithOptions(this.options, this.data);
Expand Down
2 changes: 1 addition & 1 deletion src/angular2-nvd3/angular2-nvd3.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class NvD3Component implements OnChanges, OnInit {
private ngNvD3: any;

constructor(private el: ElementRef) {
this.ngNvD3 = Angular2NvD3.NgNvD3.getInstance(this.el);
this.ngNvD3 = new Angular2NvD3.NgNvD3(this.el);
}

ngOnChanges() {
Expand Down
8 changes: 0 additions & 8 deletions src/angular2-nvd3/angular2-nvd3.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ export namespace Angular2NvD3 {
private chart: any;
private svg: any;
private viewInitialize: boolean = false;
private static instance: NgNvD3;

constructor(el) {
this.el = el;
}

static getInstance(el) {
if (!NgNvD3.instance) {
NgNvD3.instance = new NgNvD3(el);
}
return NgNvD3.instance;
}

public isViewInitialize(value: boolean) {
this.viewInitialize = value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/angular2-nvd3/angular2-nvd3.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class NvD3Directive implements OnChanges, OnInit {
private ngNvD3: any;

constructor(private el: ElementRef) {
this.ngNvD3 = Angular2NvD3.NgNvD3.getInstance(this.el);
this.ngNvD3 = new Angular2NvD3.NgNvD3(this.el);
}

ngOnChanges() {
Expand Down

0 comments on commit 560837a

Please sign in to comment.