Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. import { Component, OnInit } from '@angular/core';
  2. import {
  3. ApexAxisChartSeries,
  4. ApexChart,
  5. ApexTheme,
  6. ApexTooltip,
  7. ApexGrid,
  8. ApexYAxis,
  9. ApexLegend,
  10. ApexStroke
  11. } from 'ng-apexcharts';
  12. import { NewsService } from 'src/app/services/news.service';
  13. import { WallPostService } from 'src/app/services/wall-post.service';
  14. import { FileService } from 'src/app/services/file.service';
  15.  
  16. @Component({
  17. selector: 'app-dashboard',
  18. templateUrl: './dashboard.component.html',
  19. styleUrls: ['./dashboard.component.css']
  20. })
  21. export class DashboardComponent implements OnInit {
  22. chart: ApexChart = {
  23. height: 350,
  24. type: 'area',
  25. zoom: {
  26. enabled: false
  27. },
  28. background: 'transparent',
  29. foreColor: '#fff',
  30. toolbar: {
  31. show: false
  32. },
  33. };
  34.  
  35. series: ApexAxisChartSeries = [
  36. {
  37. name: 'Series 1',
  38. data: [45, 52, 38, 24, 33]
  39. }
  40. ];
  41.  
  42. theme: ApexTheme = {
  43. palette: 'palette5',
  44. monochrome: {
  45. enabled: false,
  46. color: '#00000',
  47. shadeTo: 'light',
  48. shadeIntensity: 0.65
  49. },
  50. };
  51.  
  52. grid: ApexGrid = {
  53. show: true,
  54. yaxis: {
  55. lines: {
  56. show: false
  57. }
  58. },
  59. xaxis: {
  60. lines: {
  61. show: false
  62. }
  63. }
  64. };
  65.  
  66. yaxis: ApexYAxis = {
  67. crosshairs: {
  68. show: true
  69. }
  70. };
  71.  
  72. tooltip: ApexTooltip = {
  73. theme: 'dark'
  74. };
  75.  
  76. labels = [
  77. 'Po',
  78. 'Út',
  79. 'St',
  80. 'Čt',
  81. 'Pá',
  82. ];
  83.  
  84. stroke: ApexStroke = {
  85. curve: 'smooth'
  86. };
  87. // line
  88. lineChart: ApexChart = {
  89. height: 350,
  90. type: 'line',
  91. zoom: {
  92. enabled: false
  93. },
  94. background: 'transparent',
  95. foreColor: '#fff',
  96. toolbar: {
  97. show: false
  98. },
  99. };
  100.  
  101. lineSeries: ApexAxisChartSeries = [
  102. {
  103. name: 'Roky',
  104. data: [0.1, 1.2, 1.4, 1.7]
  105. }
  106. ];
  107.  
  108. lineTheme: ApexTheme = {
  109. palette: 'palette10',
  110. monochrome: {
  111. enabled: false,
  112. color: '#00000',
  113. shadeTo: 'light',
  114. shadeIntensity: 0.65
  115. },
  116. };
  117.  
  118. //news
  119. news;
  120. wallPosts;
  121. dashboardDocuments;
  122.  
  123. lineLabels = [
  124. '2010',
  125. '2011',
  126. '2012',
  127. '2013'
  128. ];
  129.  
  130. constructor(private newsService: NewsService,
  131. private wallService: WallPostService,
  132. private fileService: FileService
  133. ) { }
  134.  
  135. ngOnInit() {
  136. this.news = this.newsService.getDashboardNews();
  137. this.wallPosts = this.wallService.getThreeWallPosts();
  138. this.fileService.getDashboardDocumets(10).subscribe(documents => this.dashboardDocuments = documents);
  139. }
  140.  
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement