Skip to content

Commit

Permalink
Merge pull request #212 from highcharts/dev/angular-9
Browse files Browse the repository at this point in the history
dev/angular-9
  • Loading branch information
KacperMadej authored Jul 23, 2020
2 parents 46ee36c + 1f6f586 commit 5608286
Show file tree
Hide file tree
Showing 39 changed files with 1,068 additions and 806 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ Official minimal Highcharts wrapper for Angular
5. [Demo app](#demo-app)
1. [Play with the app](#play-with-the-app)
2. [Files to play with](#files-to-play-with)
6. [Changing the Component](#changing-the-component)
7. [Help and FAQ](#help-and-faq)
6. [Online examples](#online-examples)
7. [Changing the Component](#changing-the-component)
8. [Help and FAQ](#help-and-faq)



Expand Down Expand Up @@ -379,6 +380,17 @@ Contains Angular main component that uses the *chart* component.
Contains the chart component that creates Highcharts chart.
## Online examples
* Basic line: [https://stackblitz.com/edit/highcharts-angular-basic-line](https://stackblitz.com/edit/highcharts-angular-basic-line)
* Stock: [https://stackblitz.com/edit/highcharts-angular-stock](https://stackblitz.com/edit/highcharts-angular-stock)
* Stock + indicators: [https://stackblitz.com/edit/highcharts-angular-stock-indicators](https://stackblitz.com/edit/highcharts-angular-stock-indicators)
* Stock + GUI: [https://stackblitz.com/edit/highcharts-angular-stock-gui](https://stackblitz.com/edit/highcharts-angular-stock-gui)
* Map: [https://stackblitz.com/edit/highcharts-angular-map](https://stackblitz.com/edit/highcharts-angular-map)
* Optimal way to update: [https://stackblitz.com/edit/highcharts-angular-optimal-way-to-update](https://stackblitz.com/edit/highcharts-angular-optimal-way-to-update)
* Data from the service: [https://stackblitz.com/edit/highcharts-angular-data-from-service-2](https://stackblitz.com/edit/highcharts-angular-data-from-service-2)
* Applying a custom plugin/wrap: [https://stackblitz.com/edit/highcharts-angular-custom-plugin](https://stackblitz.com/edit/highcharts-angular-custom-plugin)
## Changing the Component
Expand Down
15 changes: 13 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
Expand All @@ -24,6 +25,12 @@
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand Down Expand Up @@ -123,7 +130,8 @@
},
"configurations": {
"production": {
"project": "highcharts-angular/ng-package.prod.json"
"project": "highcharts-angular/ng-package.prod.json",
"tsConfig": "highcharts-angular/tsconfig.lib.prod.json"
}
}
},
Expand Down Expand Up @@ -159,5 +167,8 @@
"@schematics/angular:directive": {
"prefix": "app"
}
},
"cli": {
"analytics": "011d05a7-bf25-4e7e-8ea0-78f753015c1d"
}
}
}
12 changes: 12 additions & 0 deletions browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
4 changes: 2 additions & 2 deletions highcharts-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"angular"
],
"peerDependencies": {
"@angular/common": "^2.0.0-rc.0 || >=2.0.0",
"@angular/core": "^2.0.0-rc.0 || >=2.0.0",
"@angular/common": "^9.0.0",
"@angular/core": "^9.0.0",
"highcharts": ">=6.0.0"
}
}
12 changes: 6 additions & 6 deletions highcharts-angular/src/test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import { getTestBed } from "@angular/core/testing";
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
} from "@angular/platform-browser-dynamic/testing";
import "core-js/es/reflect";
import "zone.js/dist/zone";
import "zone.js/dist/zone-testing";

declare const require: any;

Expand All @@ -17,6 +17,6 @@ getTestBed().initTestEnvironment(
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
const context = require.context("./", true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
1 change: 0 additions & 1 deletion highcharts-angular/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
Expand Down
6 changes: 6 additions & 0 deletions highcharts-angular/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}
63 changes: 31 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,47 @@
"e2e": "ng e2e"
},
"dependencies": {
"@angular/animations": "7.1.0",
"@angular/common": "7.1.0",
"@angular/compiler": "7.1.0",
"@angular/core": "7.1.0",
"@angular/forms": "7.1.0",
"@angular/http": "7.1.0",
"@angular/platform-browser": "7.1.0",
"@angular/platform-browser-dynamic": "7.1.0",
"@angular/router": "7.1.0",
"core-js": "2.5.4",
"jquery": "3.5.0",
"proj4": "2.5.0",
"rxjs": "6.3.3",
"tslib": "1.9.0",
"zone.js": "0.8.26",
"highcharts": "7.1.1",
"@highcharts/map-collection": "1.1.2",
"highcharts-custom-events": "2.2.2"
"@angular/animations": "9.0.0",
"@angular/common": "9.0.0",
"@angular/compiler": "9.0.0",
"@angular/core": "9.0.0",
"@angular/forms": "9.0.0",
"@angular/platform-browser": "9.0.0",
"@angular/platform-browser-dynamic": "9.0.0",
"@angular/router": "9.0.0",
"@highcharts/map-collection": "^1.1.3",
"core-js": "^3.6.4",
"highcharts": "^8.1.2",
"highcharts-custom-events": "^3.0.2",
"jquery": "^3.5.0",
"proj4": "^2.6.0",
"rxjs": "^6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.11.0",
"@angular-devkit/build-ng-packagr": "0.11.0",
"@angular/cli": "7.1.3",
"@angular/compiler-cli": "7.1.0",
"@angular/language-service": "7.1.0",
"@types/node": "8.9.4",
"@angular-devkit/build-angular": "~0.900.1",
"@angular-devkit/build-ng-packagr": "~0.900.1",
"@angular/cli": "9.0.1",
"@angular/compiler-cli": "9.0.0",
"@angular/language-service": "9.0.0",
"@types/jasmine": "2.8.8",
"@types/jasminewd2": "2.0.3",
"codelyzer": "4.5.0",
"@types/node": "^12.11.1",
"codelyzer": "^5.2.1",
"jasmine-core": "2.99.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "3.1.1",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "2.0.1",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "0.2.2",
"ng-packagr": "4.4.0",
"protractor": "5.4.0",
"standard-version": "8.0.1",
"ts-node": "7.0.0",
"tsickle": "0.25.5",
"tslint": "5.11.0",
"typescript": "3.1.6"
"ng-packagr": "^9.0.0",
"node-sass": "^4.12.0",
"protractor": "^5.4.3",
"standard-version": "^8.0.1",
"ts-node": "^8.6.2",
"tslint": "^6.0.0",
"typescript": "3.7.5"
}
}
37 changes: 18 additions & 19 deletions src/app/app.component.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
h2 {
font-size: 20px;
color: #eeeaea;
background-color: #47475C;
padding: 10px;
.card {
border: solid 1px #E1E1E1;
border-radius: 0.5rem;
display: flex;
flex-direction: column;
margin-top: 2rem;
max-width: 1184px;
padding: 2rem;
width: 100%;
background: white;
}

.full-left {
font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
font-size: 14px;
float: left;
width: 98%;
background-color: #eee;
padding: 5px 1%;
main {
display:flex;
flex-direction: column;
align-items: center;
width: 100%;
}
.medium-right {
float: right;
width: 65%;
}
.third-left {
width: 30%;
float: left;

main:last-child {
margin-bottom: 2rem;
}
97 changes: 7 additions & 90 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,90 +1,7 @@
<div class="full-left">
<h2>Demo #1: Highcharts with a basic editor</h2>
<div class="third-left">
<button (click)="updateInputChart()">Update chart</button>
<br/>
<textarea rows="16" cols="50"
[(ngModel)]="optFromInputString"
></textarea>
<br/>
<button (click)="toggleSeriesType()">1st series type toggle</button>
</div>
<div class="medium-right">
<highcharts-chart
[Highcharts]="Highcharts"
[options]="optFromInput"
[(update)]="updateFromInput"
[oneToOne]=true
(chartInstance)="logChartInstance($event)"

style="width: 100%; height: 350px; display: block;"
></highcharts-chart>
</div>
</div>

<br/>

<div class="full-left">
<h2>Demo #2: Highstock with simple updates</h2>
<div class="third-left">
<p>Chart title text: </p>
<input
[(ngModel)]="charts[usedIndex].hcOptions.title.text"
(ngModelChange)="titleChange($event)"
>
<br/>
<p>Data sets:</p>
<button *ngFor="let i of [0,1,2]"
(click)="usedIndex = i">
{{i+1}}
</button>
</div>
<div class="medium-right">
<highcharts-chart
[Highcharts]="Highcharts"
[constructorType]="'stockChart'"
[options]="charts[usedIndex].hcOptions"
[callbackFunction]="charts[0].hcCallback"
[(update)]="updateDemo2"

style="width: 100%; height: 350px; display: block;"
></highcharts-chart>
</div>
</div>

<br/>

<div class="full-left">
<h2>Demo #3: Highmaps map chart</h2>
<highcharts-chart
[Highcharts]="Highcharts"
[constructorType]="'mapChart'"
[options]="chartMap"

style="width: 100%; height: 650px; display: block;"
></highcharts-chart>
</div>

<br/>

<div class="full-left">
<h2>Demo #4: Highcharts Gantt chart</h2>
<highcharts-chart
[Highcharts]="Highcharts"
[constructorType]="'ganttChart'"
[options]="chartGantt"

style="width: 100%; height: 350px; display: block;"
></highcharts-chart>
</div>

<div class="full-left">
<h2>Demo #5: Lazy loading in Highstock</h2>
<highcharts-chart
[Highcharts]="Highcharts"
[constructorType]="'stockChart'"
[options]="chartLazyLoading"

style="width: 100%; height: 650px; display: block;"
></highcharts-chart>
</div>
<main>
<app-line-chart class="card"></app-line-chart>
<app-stock-chart class="card"></app-stock-chart>
<app-map-chart class="card"></app-map-chart>
<app-gantt-chart class="card"></app-gantt-chart>
<app-lazy-loading-chart class="card"></app-lazy-loading-chart>
</main>
Loading

0 comments on commit 5608286

Please sign in to comment.