style(charts): refactoring components hierarchy

This commit is contained in:
Alexander Zhukov 2017-07-26 19:59:47 +03:00
parent 2d16bad88f
commit cf9ccf1850
25 changed files with 179 additions and 44 deletions

View file

@ -0,0 +1,54 @@
import { Component } from '@angular/core';
@Component({
selector: 'ngx-chart-js-pie',
styles: [
`
:host {
display: block;
}
`,
],
template: `
<canvas baseChart
[data]="pieChartData"
[labels]="pieChartLabels"
[options]="pieChartOptions"
[chartType]="pieChartType"></canvas>
`,
})
export class ChartjsPieComponent {
pieChartType: string = 'pie';
pieChartLabels: string[] = ['Download Sales', 'In-Store Sales', 'Mail Sales'];
pieChartData: number[] = [300, 500, 100];
pieChartOptions: any = {
responsive: true,
scales: {
xAxes: [{
gridLines: {
display: true,
color: 'rgba(148,159,177,1)',
},
ticks: {
fontColor: 'white',
},
}],
yAxes: [{
gridLines: {
display: true,
color: 'rgba(148,159,177,1)',
},
ticks: {
fontColor: 'white',
},
}],
},
legend: {
labels: {
fontColor: 'white',
},
},
};
}