Skip to content

Commit 595b665

Browse files
committed
Init commit
1 parent 4a1b28c commit 595b665

File tree

454 files changed

+18028
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

454 files changed

+18028
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ testem.log
4444
# System Files
4545
.DS_Store
4646
Thumbs.db
47+
/.angular

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
"@danielmoncada/angular-datetime-picker": "^13.1.1",
2626
"@ng-select/ng-select": "^8.1.1",
2727
"angular-calendar": "^0.28.20",
28+
"apexcharts": "^3.35.3",
2829
"date-fns": "^2.14.0",
2930
"font-awesome": "^4.7.0",
3031
"moment": "2.15.2",
32+
"ng-apexcharts": "^1.7.1",
3133
"ngx-smart-popover": "^1.4.0",
3234
"ngx-toastr": "^14.2.1",
3335
"rxjs": "~6.5.5",

src/app/app-routing.module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ const route: Routes = [
3838
loadChildren: () =>
3939
import('./modules/CRUD/crud.module').then((m) => m.CrudModule),
4040
},
41+
{
42+
path: 'user',
43+
canActivate: [AuthGuard],
44+
loadChildren: () => import('./modules/user/user.module').then(m => m.UserModule)
45+
},
4146
{
4247
path: 'app',
4348
loadChildren: () =>

src/app/app.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Injectable } from '@angular/core';
22

33
const hostApi =
4-
process.env.NODE_ENV === 'development' ? 'http://localhost' : '';
5-
const portApi = process.env.NODE_ENV === 'development' ? 8080 : '';
4+
process.env.NODE_ENV !== 'development' ? 'http://localhost' : '';
5+
const portApi = process.env.NODE_ENV !== 'development' ? 8080 : '';
66
const baseURLApi = `${hostApi}${portApi ? `:${portApi}` : ``}`;
77

88
@Injectable({

src/app/consts/routes.ts

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { RouterModule, Routes } from '@angular/router';
2+
import { NgModule } from '@angular/core';
3+
4+
import {
5+
BarChartsPageComponent,
6+
LineChartsPageComponent,
7+
OverviewChartsPageComponent,
8+
PieChartsPageComponent
9+
} from './containers';
10+
11+
const routes: Routes = [
12+
{
13+
path: '',
14+
redirectTo: 'overview'
15+
},
16+
{
17+
path: 'overview',
18+
component: OverviewChartsPageComponent
19+
},
20+
{
21+
path: 'line',
22+
component: LineChartsPageComponent
23+
},
24+
{
25+
path: 'bar',
26+
component: BarChartsPageComponent
27+
},
28+
{
29+
path: 'pie',
30+
component: PieChartsPageComponent
31+
},
32+
];
33+
34+
@NgModule({
35+
imports: [
36+
RouterModule.forChild(routes)
37+
],
38+
exports: [RouterModule]
39+
})
40+
41+
export class ChartsRoutingModule {
42+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { MatButtonModule } from '@angular/material/button';
4+
import { MatToolbarModule } from '@angular/material/toolbar';
5+
import { MatCardModule} from '@angular/material/card';
6+
import { NgApexchartsModule } from 'ng-apexcharts';
7+
import { MatGridListModule } from '@angular/material/grid-list';
8+
9+
import { ChartsRoutingModule } from './charts-routing.module';
10+
import {
11+
OverviewChartsPageComponent,
12+
LineChartsPageComponent,
13+
BarChartsPageComponent,
14+
PieChartsPageComponent
15+
} from './containers';
16+
import { SharedModule } from '../../../shared/shared.module';
17+
import { ChartsService } from './services';
18+
import {
19+
DashedLineChartComponent,
20+
HeatmapChartComponent,
21+
LineChartComponent,
22+
PieChartComponent,
23+
RadarChartComponent,
24+
BarChartComponent,
25+
BasicLineChartComponent,
26+
LineDataLabelsChartComponent,
27+
ZoomableTimeseriesChartComponent,
28+
GroupedBarChartComponent,
29+
StackedBarChartComponent,
30+
ImageBarChartComponent,
31+
SimplePieChartComponent,
32+
UpdatePieChartComponent,
33+
MonochomePieChartComponent
34+
} from './components';
35+
import { DynamicUpdatingChartComponent } from './components/dynamic-updating-chart/dynamic-updating-chart.component';
36+
37+
38+
@NgModule({
39+
declarations: [
40+
OverviewChartsPageComponent,
41+
LineChartsPageComponent,
42+
BarChartsPageComponent,
43+
PieChartsPageComponent,
44+
LineChartComponent,
45+
HeatmapChartComponent,
46+
DashedLineChartComponent,
47+
PieChartComponent,
48+
RadarChartComponent,
49+
BarChartComponent,
50+
BasicLineChartComponent,
51+
LineDataLabelsChartComponent,
52+
ZoomableTimeseriesChartComponent,
53+
GroupedBarChartComponent,
54+
StackedBarChartComponent,
55+
ImageBarChartComponent,
56+
SimplePieChartComponent,
57+
UpdatePieChartComponent,
58+
MonochomePieChartComponent,
59+
DynamicUpdatingChartComponent
60+
],
61+
imports: [
62+
CommonModule,
63+
ChartsRoutingModule,
64+
SharedModule,
65+
MatToolbarModule,
66+
MatCardModule,
67+
MatButtonModule,
68+
NgApexchartsModule,
69+
MatGridListModule
70+
],
71+
providers: [
72+
ChartsService
73+
]
74+
})
75+
export class ChartsModule { }
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<div #chart></div>
2+

src/app/modules/templates/charts/components/bar-chart/bar-chart.component.scss

Whitespace-only changes.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import {AfterViewInit, Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';
2+
3+
import {ChartOptions} from '../../models/chart-options';
4+
import { colors } from '../../../../../consts';
5+
import {BarChartData} from '../../models/bar-chart-data';
6+
7+
@Component({
8+
selector: 'app-bar-chart',
9+
templateUrl: './bar-chart.component.html',
10+
styleUrls: ['./bar-chart.component.scss']
11+
})
12+
export class BarChartComponent implements OnInit, OnChanges, AfterViewInit {
13+
@Input() barChartData: BarChartData;
14+
@Input() currentTheme: string;
15+
@ViewChild('chart') chart: ElementRef;
16+
17+
// @ts-ignore
18+
public chartObj: ApexCharts;
19+
public apexBarChartOptions: Partial<ChartOptions>;
20+
public colors: typeof colors = colors;
21+
22+
public ngOnInit(): void {
23+
this.initChart();
24+
}
25+
26+
public ngOnChanges(changes: SimpleChanges): void {
27+
if (changes.currentTheme.currentValue && this.chartObj) {
28+
this.chartObj.updateOptions({
29+
colors: [
30+
changes.currentTheme.currentValue === 'blue'
31+
? colors.BLUE
32+
: this.currentTheme === 'green'
33+
? colors.GREEN
34+
: colors.PINK
35+
]
36+
})
37+
}
38+
}
39+
40+
public ngAfterViewInit() {
41+
// @ts-ignore
42+
this.chartObj = new ApexCharts(
43+
this.chart.nativeElement,
44+
this.apexBarChartOptions
45+
)
46+
47+
this.chartObj.render();
48+
}
49+
50+
public initChart(): void {
51+
this.apexBarChartOptions = {
52+
series: this.barChartData.series,
53+
chart: {
54+
type: "bar",
55+
height: 350,
56+
toolbar: {
57+
show: false
58+
}
59+
},
60+
plotOptions: {
61+
bar: {
62+
horizontal: true
63+
}
64+
},
65+
colors: [
66+
this.currentTheme === 'blue'
67+
? colors.BLUE
68+
: this.currentTheme === 'green'
69+
? colors.GREEN
70+
: colors.PINK
71+
],
72+
dataLabels: {
73+
enabled: false
74+
},
75+
xaxis: {
76+
categories: this.barChartData.categories
77+
}
78+
};
79+
}
80+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div #chart></div>

src/app/modules/templates/charts/components/basic-line-chart/basic-line-chart.component.scss

Whitespace-only changes.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import {AfterViewInit, Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';
2+
import {LineChartData} from '../../models';
3+
import {ChartOptions} from '../../models/chart-options';
4+
5+
import { colors } from '../../../../../consts';
6+
7+
@Component({
8+
selector: 'app-basic-line-chart',
9+
templateUrl: './basic-line-chart.component.html',
10+
styleUrls: ['./basic-line-chart.component.scss']
11+
})
12+
export class BasicLineChartComponent implements OnInit, OnChanges, AfterViewInit {
13+
@Input() basicLineChartData: LineChartData;
14+
@Input() currentTheme: string;
15+
@ViewChild('chart') chart: ElementRef;
16+
17+
// @ts-ignore
18+
public chartObj: ApexCharts;
19+
public apexBasicLineChartOptions: Partial<ChartOptions>;
20+
public colors: typeof colors = colors;
21+
22+
public ngOnInit(): void {
23+
this.initChart();
24+
}
25+
26+
public ngOnChanges(changes: SimpleChanges): void {
27+
if (changes.currentTheme.currentValue && this.chartObj) {
28+
this.chartObj.updateOptions({
29+
colors: [
30+
changes.currentTheme.currentValue === 'blue'
31+
? colors.BLUE
32+
: this.currentTheme === 'green'
33+
? colors.GREEN
34+
: colors.PINK
35+
],
36+
grid: {
37+
row: {
38+
colors: [
39+
this.currentTheme === 'blue'
40+
? colors.BLUE
41+
: this.currentTheme === 'green'
42+
? colors.GREEN
43+
: colors.PINK,
44+
"transparent"
45+
],
46+
opacity: 0.2
47+
}
48+
}
49+
})
50+
}
51+
}
52+
53+
public ngAfterViewInit() {
54+
// @ts-ignore
55+
this.chartObj = new ApexCharts(
56+
this.chart.nativeElement,
57+
this.apexBasicLineChartOptions
58+
)
59+
60+
this.chartObj.render();
61+
}
62+
63+
public initChart(): void {
64+
this.apexBasicLineChartOptions = {
65+
series: this.basicLineChartData.series,
66+
chart: {
67+
height: 350,
68+
type: "line",
69+
zoom: {
70+
enabled: false
71+
},
72+
toolbar: {
73+
show: false
74+
}
75+
},
76+
dataLabels: {
77+
enabled: false
78+
},
79+
colors: [
80+
this.currentTheme === 'blue'
81+
? colors.BLUE
82+
: this.currentTheme === 'green'
83+
? colors.GREEN
84+
: colors.PINK
85+
],
86+
stroke: {
87+
curve: "straight"
88+
},
89+
grid: {
90+
row: {
91+
colors: [
92+
this.currentTheme === 'blue'
93+
? colors.BLUE
94+
: this.currentTheme === 'green'
95+
? colors.GREEN
96+
: colors.PINK,
97+
"transparent"
98+
],
99+
opacity: 0.2
100+
}
101+
},
102+
xaxis: {
103+
categories: this.basicLineChartData.categories
104+
}
105+
};
106+
}
107+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<apx-chart
2+
[series]="apexDashedLineChartOptions.series"
3+
[chart]="apexDashedLineChartOptions.chart"
4+
[xaxis]="apexDashedLineChartOptions.xaxis"
5+
[stroke]="apexDashedLineChartOptions.stroke"
6+
[tooltip]="apexDashedLineChartOptions.tooltip"
7+
[dataLabels]="apexDashedLineChartOptions.dataLabels"
8+
[legend]="apexDashedLineChartOptions.legend"
9+
[markers]="apexDashedLineChartOptions.markers"
10+
[grid]="apexDashedLineChartOptions.grid"
11+
[colors]="apexDashedLineChartOptions.colors"
12+
></apx-chart>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)