Skip to content

Instantly share code, notes, and snippets.

@arn-ob
Last active April 1, 2018 16:28
Show Gist options
  • Select an option

  • Save arn-ob/a38fd29fd684b61b178a485cdb70e03d to your computer and use it in GitHub Desktop.

Select an option

Save arn-ob/a38fd29fd684b61b178a485cdb70e03d to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
type;
data_list = [65, 59, 80, 81, 56, 55, 40];
data;
options;
ngOnInit() {
this.chart_create_function();
}
chart_create_function() {
this.type = 'line';
this.data = {
labels : this.data_list,
datasets: [
{
data: this.data_list
}
]
};
this.options = {
responsive: true,
maintainAspectRatio: false
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment