Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ion-content padding>
- <div class="row" style="display: block;">
- <div class="col-md-6">
- <div style="display: block;">
- <canvas baseChart width="1200" height="600"
- [datasets]="lineChartData"
- [labels]="lineChartLabels"
- [options]="lineChartOptions"
- [colors]="lineChartColors"
- [legend]="lineChartLegend"
- [chartType]="lineChartType"
- (chartHover)="chartHovered($event)"
- (chartClick)="chartClicked($event)"></canvas>
- </div>
- </div>
- </div>
- </ion-content>
- // Initializing Chart settings
- public lineChartLegend:boolean = true;
- public lineChartType:string = 'line';
- public lineChartData:ChartDataSets[] = [{ data: this.scoreArr, label: 'Image Scores' }];
- public lineChartLabels:Label[] = [];
- public lineChartOptions: (ChartOptions & { annotation: any }) = {
- responsive: true,
- scales: {
- // We use this empty structure as a placeholder for dynamic theming.
- xAxes: [{}],
- yAxes: [
- {
- id: 'y-axis-0',
- position: 'left',
- }
- ]
- },
- annotation: {
- annotations: [
- {
- type: 'line',
- mode: 'vertical',
- scaleID: 'x-axis-0',
- value: 'March',
- borderColor: 'orange',
- borderWidth: 2,
- label: {
- enabled: true,
- fontColor: 'orange',
- content: 'LineAnno'
- }
- },
- ],
- }
- };
- public lineChartColors:Color[] = [
- { // dark grey
- backgroundColor: 'rgba(77,83,96,0.2)',
- borderColor: 'rgba(77,83,96,1)',
- pointBackgroundColor: 'rgba(77,83,96,1)',
- pointBorderColor: '#fff',
- pointHoverBackgroundColor: '#fff',
- pointHoverBorderColor: 'rgba(77,83,96,1)'
- }
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement