added labels

This commit is contained in:
Bluepr1nt
2017-04-04 21:51:29 +02:00
parent c165b1f45e
commit 98150f157d
7 changed files with 61 additions and 20 deletions
+10 -2
View File
@@ -14,7 +14,12 @@ export class LineChartComponent implements OnInit {
];
public lineChartLabels:Array<any> = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
public lineChartOptions:any = {
responsive: true
responsive: true,
title: {
display: true,
position: 'left',
text: 'Watt'
}
};
public lineChartColors:Array<any> = [
{ // grey
@@ -46,10 +51,13 @@ export class LineChartComponent implements OnInit {
.get()
.subscribe(res => {
console.log(res);
const newDataSet = [];
const newLine = {data: res.data, label: res.label};
const newLine = {data: res.lines.data, label: res.lines.label};
newDataSet.push(newLine);
this.lineChartData = newDataSet;
this.lineChartLabels = res.labels.data;
});
console.log("Init");