Skip to content

Commit 2d1881e

Browse files
committed
up
1 parent f486b4f commit 2d1881e

File tree

9 files changed

+97
-33
lines changed

9 files changed

+97
-33
lines changed

package-lock.json

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test": "ng test",
1010
"lint": "ng lint",
1111
"e2e": "ng e2e",
12-
"ng:serve":"ng serve --proxy-config proxy.config.json"
12+
"ng:serve": "ng serve --proxy-config proxy.config.json"
1313
},
1414
"private": true,
1515
"dependencies": {
@@ -22,7 +22,9 @@
2222
"@angular/platform-browser": "^5.2.0",
2323
"@angular/platform-browser-dynamic": "^5.2.0",
2424
"@angular/router": "^5.2.0",
25+
"angular-highcharts": "^5.2.13",
2526
"core-js": "^2.4.1",
27+
"highcharts": "^6.1.1",
2628
"moment": "^2.22.2",
2729
"ngx-bootstrap": "^2.0.5",
2830
"ngx-embed-video": "^0.3.0",
@@ -36,6 +38,7 @@
3638
"@angular/cli": "~1.7.4",
3739
"@angular/compiler-cli": "^5.2.0",
3840
"@angular/language-service": "^5.2.0",
41+
"@types/highcharts": "^5.0.26",
3942
"@types/jasmine": "~2.8.3",
4043
"@types/jasminewd2": "~2.0.2",
4144
"@types/lodash": "^4.14.115",

src/app/app.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { PublicModule } from './public/public.module';
1111
import { HTTPService } from './Providers/httpservice';
1212
import { PrivateModule } from './private/private.module';
1313
import { AlwaysAuthGuard, OnlyLoggedInUsersGuard } from './AlwaysAuthGuard ';
14+
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
1415
@NgModule({
1516
declarations: [
1617
AppComponent,
@@ -28,13 +29,14 @@ import { AlwaysAuthGuard, OnlyLoggedInUsersGuard } from './AlwaysAuthGuard ';
2829
],
2930
exports: [
3031
ToastrModule,
31-
FormsModule,
32+
FormsModule
3233
],
3334
providers: [
3435
HttpClient,
3536
HTTPService,
3637
AlwaysAuthGuard,
3738
OnlyLoggedInUsersGuard,
39+
{ provide: LocationStrategy, useClass: HashLocationStrategy }
3840
],
3941
bootstrap: [AppComponent],
4042
schemas: [

src/app/private/about/about.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<div class="container">
22
<div class="row">
3-
<h2>Data Charts</h2>
4-
<hr>
3+
<h2>About Us</h2>
54
<div class="col-md-12">
65

76
</div>
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1-
<!-- <div class="cotainer">
2-
<div [chart]="chart"></div>
3-
</div>> -->
1+
<div class="cotainer">
2+
<div class="row">
3+
<div class="col-md-12">
4+
<button (click)="add()" class="btn btn-danger">Add Point!</button>
5+
<div [chart]="linechart"></div>
6+
</div>
7+
8+
<div class="col-md-12">
9+
<!-- <button (click)="add()" class="btn btn-danger">Add Point!</button> -->
10+
<div [chart]="barchart"></div>
11+
</div>
12+
</div>
13+
14+
</div>

src/app/private/demo-charts/demo-charts.component.ts

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,54 @@ import { Chart } from 'angular-highcharts';
77
styleUrls: ['./demo-charts.component.css']
88
})
99
export class DemoChartsComponent implements OnInit {
10-
public chart: Chart = new Chart();
10+
public linechart = new Chart();
11+
public barchart = new Chart();
1112

1213
constructor() {
13-
14+
this.initiateLineChart();
15+
this.initiateBarChart();
1416
}
1517

1618
ngOnInit() {
1719

18-
// this.chart = new Chart({
19-
// chart: {
20-
// type: 'line'
21-
// },
22-
// title: {
23-
// text: 'Linechart'
24-
// },
25-
// credits: {
26-
// enabled: false
27-
// },
28-
// series: [
29-
// {
30-
// name: 'Line 1',
31-
// data: [1, 2, 3]
32-
// }
33-
// ]
34-
// });
20+
}
21+
22+
add() {
23+
this.linechart.addPoint(Math.floor(Math.random() * 10));
24+
}
25+
26+
initiateLineChart() {
27+
this.linechart = new Chart({
28+
chart: {
29+
type: 'line'
30+
},
31+
title: {
32+
text: 'Line Chart'
33+
},
34+
series: [
35+
{
36+
name: 'Line 1',
37+
data: [1, 2, 3]
38+
}
39+
]
40+
});
41+
}
42+
43+
initiateBarChart() {
44+
this.barchart = new Chart({
45+
chart: {
46+
type: 'bar'
47+
},
48+
title: {
49+
text: 'Bar Chart'
50+
},
51+
series: [
52+
{
53+
name: 'Line 1',
54+
data: [1, 2, 3]
55+
}
56+
]
57+
});
3558
}
3659

3760
}

src/app/private/gallery/gallery.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ <h2> Image Gallery</h2>
88
</div>
99
</div>
1010
</div>
11-
<hr>
1211
<div class="row">
1312
<h2> Video Gallery</h2>
1413
<hr>

src/app/private/header/header.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ <h2><i class="fas fa-home"></i> Admin Panel</h2>
2929
<div class="collapse navbar-collapse" id="myNavbar">
3030
<ul class="nav navbar-nav">
3131
<li [routerLinkActive]="['active']" [routerLink]="['/user/home']">
32-
<a>Data Grid</a>
32+
<a>Grid</a>
3333
</li>
3434
<li [routerLinkActive]="['active']" [routerLink]="['/user/demo-charts']">
3535
<a>Charts</a>
3636
</li>
37-
<li [routerLinkActive]="['active']" [routerLink]="['/user/about']">
38-
<a>Data Charts</a>
39-
</li>
4037
<li [routerLinkActive]="['active']" [routerLink]="['/user/gallery']">
41-
<a>Media Gallery</a>
38+
<a>Media</a>
39+
</li>
40+
<li [routerLinkActive]="['active']" [routerLink]="['/user/about']">
41+
<a>About</a>
4242
</li>
4343
<li>
4444
<a href="javascript:;">Contact</a>

src/app/private/private.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ChartModule } from 'angular-highcharts';
12
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
23
import { CommonModule } from '@angular/common';
34
import { PrivateFooterComponent } from './footer/footer.component';
@@ -22,7 +23,8 @@ import { HttpModule } from '@angular/http';
2223
HttpModule,
2324
EmbedVideo.forRoot(),
2425
SharedModule,
25-
AppRoutingModule
26+
AppRoutingModule,
27+
ChartModule
2628
],
2729
declarations: [
2830
PrivateComponent,

0 commit comments

Comments
 (0)