Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. <ion-content padding>
  2. <div class="row" style="display: block;">
  3. <div class="col-md-6">
  4. <div style="display: block;">
  5. <canvas baseChart width="1200" height="600"
  6. [datasets]="lineChartData"
  7. [labels]="lineChartLabels"
  8. [options]="lineChartOptions"
  9. [colors]="lineChartColors"
  10. [legend]="lineChartLegend"
  11. [chartType]="lineChartType"
  12. (chartHover)="chartHovered($event)"
  13. (chartClick)="chartClicked($event)"></canvas>
  14. </div>
  15. </div>
  16. </div>
  17. </ion-content>
  18.  
  19. // Initializing Chart settings
  20. public lineChartLegend:boolean = true;
  21. public lineChartType:string = 'line';
  22. public lineChartData:ChartDataSets[] = [{ data: this.scoreArr, label: 'Image Scores' }];
  23. public lineChartLabels:Label[] = [];
  24. public lineChartOptions: (ChartOptions & { annotation: any }) = {
  25. responsive: true,
  26. scales: {
  27. // We use this empty structure as a placeholder for dynamic theming.
  28. xAxes: [{}],
  29. yAxes: [
  30. {
  31. id: 'y-axis-0',
  32. position: 'left',
  33. }
  34. ]
  35. },
  36. annotation: {
  37. annotations: [
  38. {
  39. type: 'line',
  40. mode: 'vertical',
  41. scaleID: 'x-axis-0',
  42. value: 'March',
  43. borderColor: 'orange',
  44. borderWidth: 2,
  45. label: {
  46. enabled: true,
  47. fontColor: 'orange',
  48. content: 'LineAnno'
  49. }
  50. },
  51. ],
  52. }
  53. };
  54. public lineChartColors:Color[] = [
  55. { // dark grey
  56. backgroundColor: 'rgba(77,83,96,0.2)',
  57. borderColor: 'rgba(77,83,96,1)',
  58. pointBackgroundColor: 'rgba(77,83,96,1)',
  59. pointBorderColor: '#fff',
  60. pointHoverBackgroundColor: '#fff',
  61. pointHoverBorderColor: 'rgba(77,83,96,1)'
  62. }
  63. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement