Skip to content

Commit 65379d5

Browse files
committed
Add dashboard page
1 parent d29a0eb commit 65379d5

File tree

9 files changed

+46
-12
lines changed

9 files changed

+46
-12
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"angular-calendar": "^0.28.20",
2828
"apexcharts": "^3.35.3",
2929
"date-fns": "^2.14.0",
30+
"echarts": "^4.7.0",
3031
"font-awesome": "^4.7.0",
3132
"moment": "2.15.2",
3233
"ng-apexcharts": "^1.7.1",

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { RouterModule } from '@angular/router';
55
import { ToastrModule } from 'ngx-toastr';
66
import { MatCardModule } from '@angular/material/card';
77
import { MatButtonModule } from '@angular/material/button';
8+
import { DashboardModule } from './modules/dashboard/dashboard.module';
89

910
import { AppComponent } from './app.component';
1011
import { SharedModule } from './shared/shared.module';
@@ -31,6 +32,7 @@ import { HttpInterceptorService } from './shared/services/http-interceptor.servi
3132
CrudModule,
3233
BrowserAnimationsModule,
3334
RouterModule,
35+
DashboardModule,
3436
AppRoutingModule,
3537
ToastrModule.forRoot(),
3638
MatCardModule,

src/app/consts/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export enum routes {
2-
DASHBOARD = '/app/dashboard',
2+
DASHBOARD = '/dashboard',
33
PROFILE = '/user/profile',
44
CHANGE_PASSWORD = '/app/change-password',
55
LOGIN = '/login',

src/app/modules/dashboard/components/daily-line-chart/daily-line-chart.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ import {
77
ApexTooltip,
88
ApexMarkers,
99
ApexXAxis,
10+
ApexStroke,
11+
ApexLegend,
12+
ApexGrid,
1013
ApexPlotOptions
1114
} from 'ng-apexcharts';
1215

1316
import { DailyLineChartData, TimeData } from '../../models';
1417
import { colors } from '../../../../consts';
1518
import { customTooltip } from '../../consts';
19+
import * as ApexCharts from 'apexcharts';
1620

1721
type ChartOptions = {
1822
series: ApexAxisChartSeries;
@@ -163,7 +167,7 @@ export class DailyLineChartComponent implements OnInit, OnChanges, AfterViewInit
163167
stops: [0, 100, 100, 100]
164168
}
165169
},
166-
labels: labels,
170+
labels,
167171
xaxis: {
168172
type: 'datetime',
169173
labels: {

src/app/modules/dashboard/components/project-stat-chart/project-stat-chart.component.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
import { Component, Input, OnInit } from '@angular/core';
2-
2+
import {
3+
ApexAxisChartSeries,
4+
ApexChart,
5+
ApexFill,
6+
ApexYAxis,
7+
ApexTooltip,
8+
ApexMarkers,
9+
ApexXAxis,
10+
ApexStroke,
11+
ApexLegend,
12+
ApexGrid,
13+
ApexPlotOptions,
14+
ApexDataLabels
15+
} from 'ng-apexcharts';
316
import { ProjectStatData, ProjectTimeData } from '../../models';
417
import { colors } from '../../../../consts';
518

src/app/modules/dashboard/components/server-chart/server-chart.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
ApexStroke,
88
ApexYAxis,
99
ApexTitleSubtitle,
10-
ApexLegend, ApexGrid
10+
ApexLegend, ApexGrid, ApexFill
1111
} from 'ng-apexcharts';
1212

1313
import { ServerChartData } from '../../models';

src/app/modules/dashboard/components/visits-chart/visits-chart.component.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {AfterViewInit, Component, ElementRef, Input, OnChanges, SimpleChanges, V
22

33
import { VisitsChartData } from '../../models';
44
import { colors } from '../../../../consts';
5-
import {ChartOptions} from '../../../templates/charts/models/chart-options';
5+
import { ChartOptions } from '../../../templates/charts/models/chart-options';
66

77
@Component({
88
selector: 'app-visits-chart',
@@ -19,6 +19,7 @@ export class VisitsChartComponent implements OnChanges, AfterViewInit {
1919
public colors: typeof colors = colors;
2020
public chartOptions: Partial<ChartOptions>;
2121

22+
// tslint:disable-next-line:use-lifecycle-interface
2223
public ngOnInit(): void {
2324
this.initChart();
2425
}
@@ -35,15 +36,15 @@ export class VisitsChartComponent implements OnChanges, AfterViewInit {
3536
: colors.PINK
3637
]
3738
}
38-
})
39+
});
3940
}
4041
}
4142

4243
public ngAfterViewInit() {
4344
this.chartObj = new ApexCharts(
4445
this.chart.nativeElement,
4546
this.chartOptions
46-
)
47+
);
4748

4849
this.chartObj.render();
4950
}
@@ -54,7 +55,7 @@ export class VisitsChartComponent implements OnChanges, AfterViewInit {
5455
chart: {
5556
height: 130,
5657
width: 130,
57-
type: "radialBar",
58+
type: 'radialBar',
5859
offsetY: -10
5960
},
6061
plotOptions: {
@@ -63,16 +64,16 @@ export class VisitsChartComponent implements OnChanges, AfterViewInit {
6364
endAngle: 180,
6465
dataLabels: {
6566
name: {
66-
fontSize: "16px",
67+
fontSize: '16px',
6768
color: undefined,
6869
offsetY: 120
6970
},
7071
value: {
7172
offsetY: 76,
72-
fontSize: "22px",
73+
fontSize: '22px',
7374
color: undefined,
74-
formatter: function(val) {
75-
return val + "%";
75+
formatter(val) {
76+
return val + '%';
7677
}
7778
},
7879
show: false

src/app/modules/dashboard/containers/dashboard-page/dashboard-page.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export class DashboardPageComponent {
4343
this.projectsStatsData$ = this.service.loadProjectsStatsData();
4444
}
4545

46+
// tslint:disable-next-line:use-lifecycle-interface
4647
public ngOnInit(): void {
4748
this.sharedService.currentTheme.subscribe((theme: string) => {
4849
this.currentTheme = theme;

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,6 +2777,13 @@ domutils@^2.8.0:
27772777
domelementtype "^2.2.0"
27782778
domhandler "^4.2.0"
27792779

2780+
echarts@^4.7.0:
2781+
version "4.9.0"
2782+
resolved "https://registry.yarnpkg.com/echarts/-/echarts-4.9.0.tgz#a9b9baa03f03a2a731e6340c55befb57a9e1347d"
2783+
integrity sha512-+ugizgtJ+KmsJyyDPxaw2Br5FqzuBnyOWwcxPKO6y0gc5caYcfnEUIlNStx02necw8jmKmTafmpHhGo4XDtEIA==
2784+
dependencies:
2785+
zrender "4.3.2"
2786+
27802787
27812788
version "1.1.1"
27822789
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
@@ -6313,3 +6320,8 @@ zone.js@~0.11.4:
63136320
integrity sha512-DDh2Ab+A/B+9mJyajPjHFPWfYU1H+pdun4wnnk0OcQTNjem1XQSZ2CDW+rfZEUDjv5M19SBqAkjZi0x5wuB5Qw==
63146321
dependencies:
63156322
tslib "^2.0.0"
6323+
6324+
6325+
version "4.3.2"
6326+
resolved "https://registry.yarnpkg.com/zrender/-/zrender-4.3.2.tgz#ec7432f9415c82c73584b6b7b8c47e1b016209c6"
6327+
integrity sha512-bIusJLS8c4DkIcdiK+s13HiQ/zjQQVgpNohtd8d94Y2DnJqgM1yjh/jpDb8DoL6hd7r8Awagw8e3qK/oLaWr3g==

0 commit comments

Comments
 (0)