Closed codxse closed 8 years ago
Hallo, I am using nvd3 on ionic 2.0.0-beta.30. All working fine until I want update chart from onChange event.
Here my template:
<div> <nvd3 [options]="options" [data]="data"></nvd3> </div> <ion-list> <!-- <ion-item> <ion-label>Kategori</ion-label> <ion-select [(ngModel)]="kategori" (ngModelChange)="onChange($event, 'kategori')"> <ion-option value="lowongan">Lowongan</ion-option> <ion-option value="pencari">Pencari</ion-option> </ion-select> </ion-item> --> <ion-item> <ion-label>Tahun</ion-label> <ion-select [(ngModel)]="tahun" (ngModelChange)="onChange($event, 'tahun')"> <ion-option *ngFor="let data of dataArr" [ngValue]="data.tahun">{{data.tahun | date:'y'}}</ion-option> </ion-select> </ion-item> </ion-list>
and here my ng
onChange(newValue, ngModel) { console.log("onChange"); if (ngModel == 'tahun') { for (let element of this.dataArr) { if (element.tahun = newValue) { console.log(element.values); this.data = element.values; this.nvD3.updateWithData(this.data); break; } } this.dataArr.indexOf(this.dataArr.newValue); this.tahun = new Date(newValue); console.log(this.tahun); } }
Not that, I have tried this.nvD3.chart.update() too. Still not update the DOM. If you don't mind, here my full code https://github.com/codxse/batavia/blob/master/app/pages/ikhtisar-statistik-pie/ikhtisar-statistik-pie.ts
this.nvD3.chart.update()
Thanks again Best Regards.
Sorry, my foolish mistake. this code (element.tahun = newValue) should be (element.tahun == newValue)
(element.tahun = newValue)
(element.tahun == newValue)
Hallo, I am using nvd3 on ionic 2.0.0-beta.30. All working fine until I want update chart from onChange event.
Here my template:
and here my ng
Not that, I have tried
this.nvD3.chart.update()
too. Still not update the DOM. If you don't mind, here my full code https://github.com/codxse/batavia/blob/master/app/pages/ikhtisar-statistik-pie/ikhtisar-statistik-pie.tsThanks again Best Regards.