valor-software / ng2-charts

Beautiful charts for Angular based on Chart.js
http://valor-software.github.io/ng2-charts/
MIT License
2.35k stars 573 forks source link

problem with chart labels #610

Closed stojankukrika closed 7 years ago

stojankukrika commented 7 years ago

HI, I have problem with char labels. I use it like angular call service who get data and chart need to shows in html data. I use last versions of charjs (2.4.0), ng2-charts(1.5.0) angular (2.4.0). Here is mine code:

ngOnInit(): void {
        this.getStatusChart();
    }
private getStatusChart() {
        this._statisticService.getStatusChart().subscribe( (response) => {
                this.result = response;
                this.doughnutChartDataStatus = this.result.values;
                this.doughnutChartLabelsStatus = ["Open","Assigned","In progress","Complete","Close","Dismiss"];
        });
    }

and here is how it's look like: char

If I put labes in setup variable (before constructor, set as local variable), then it works. Can anybody know what is the problem?

stojankukrika commented 7 years ago

I move to https://www.npmjs.com/package/angular2-highcharts and thy make it to works perfect! Use it and enjoy ;)