Skip to content

Commit

Permalink
Update Angular CLI in the demo to avoid security issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperMadej committed Dec 8, 2017
1 parent 21cd419 commit 9493ab7
Show file tree
Hide file tree
Showing 5 changed files with 1,849 additions and 3,526 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,19 @@ Where `"myMapName"` is yours map name that will be used when creating charts. Ne
...
```
The map is ready to be imported to your app.
The map is ready to be imported to your app. Use `require` instead of import to prevent TS5055 errors.
```ts
import * as Highcharts from 'highcharts/highmaps';
import * as HC_myMap from './relative-path-to-the-map-file/map-file-name';
HC_myMap(Highcharts);
require('./relative-path-to-the-map-file/map-file-name')(Highcharts);
```
Where `relative-path-to-the-map-file` should be relative (for the module importing the map) path to the map file and `map-file-name` should be the name of the map file.
The file should be placed in a directory that is not checked by typeScript. See example in this repository:
- config in 'tsconfig.json'
- map file in 'js' directory
### To load a wrapper
A wrapper is a [custom extension](https://www.highcharts.com/docs/extending-highcharts/extending-highcharts) for Highcharts. To load a wrapper the same way as a module you could save it as a Javascript file and edit it by adding to beginning and end of a file same code as for a map:
Expand Down Expand Up @@ -290,27 +293,28 @@ Next, you will be loading a local .js file, so you should add in `tsconfig.json`
...
```
The wrapper is ready to be imported to your app.
The wrapper is ready to be imported to your app. Use `require` instead of import to prevent TS5055 errors.
```ts
import * as Highcharts from 'highcharts';
import * as HC_myWrapper from './relative-path-to-the-wrapper-file/wrapper-file-name';
HC_myWrapper(Highcharts);
require('./relative-path-to-the-wrapper-file/wrapper-file-name')(Highcharts);
```
Where `relative-path-to-the-wrapper-file` should be relative (for the module importing the wrapper) path to the wrapper file and `wrapper-file-name` should be the name of the wrapper file.
The file should be placed in a directory that is not checked by typeScript. See example in this repository:
- config in 'tsconfig.json'
- map file in 'js' directory
### To use [`setOptions`](https://www.highcharts.com/docs/getting-started/how-to-set-options#2)
The best place to use `setOptions` is afer your Highcharts instance is ready and before Highcharts variable is set in the main component. Example:
```
import * as Highcharts from 'highcharts/highstock';
import * as HC_map from 'highcharts/modules/map';
import * as HC_myMap from './worldmap.js';

HC_map(Highcharts);
HC_myMap(Highcharts);

Highcharts.setOptions({
title: {
Expand Down
File renamed without changes.
Loading

0 comments on commit 9493ab7

Please sign in to comment.