question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Suggest] Documentation update

See original GitHub issue

Hi, Thank you for the great library. Just for people that using AOT compilation (typically people that use angular-cli), you have to add the following code to your AppModule in order to work:

In your AppModule:

import {HighchartsStatic} from 'angular2-highcharts/dist/HighchartsService';
import {ChartModule} from "angular2-highcharts";

export function highchartsFactory() {
  return require('highcharts');
}

@NgModule({
   providers:[
   ...
   {
      provide: HighchartsStatic,
      useFactory: highchartsFactory
    },
    ....
]}

In the module where you use the chart directive:


@NgModule({
   imports: [
     ChartModule
   ],
 ]}

You could also declare as a singleton (ShareModule)

Thank you !

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:19
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
jesseniccommented, Feb 16, 2017

How would you load Highcharts modules with this solution? Modules like highcharts/modules/solid-gauge.

Edit: This seems to work for exporting, and for solid gauge:

export function highchartsFactory() {
    var hc = require('highcharts');
    var hcm = require('highcharts/highcharts-more');
    var exp = require('highcharts/modules/exporting');
    var sg = require('highcharts/modules/solid-gauge');

    hcm(hc);
    exp(hc);
    sg(hc);
    return hc;
}

(Added highcharts-more to make solid gauge work)

3reactions
gevgenycommented, Feb 13, 2017

Yea, would be great. But HighchartsService supposed to be private part of the lib. Are there any simplier approach to achieve this ? I would change something in the lib if it is necessary

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suggest edits in Google Docs - Computer
Suggest changes to a file. On your computer, open a document at docs.google.com. Select the text you want to change. A button appears...
Read more >
8 Tips for Keeping Your Process Documentation Up to Date
How often do your update your docs? Have your policies and procedures changed but your documents haven't been updated? Do your help guides ......
Read more >
Suggesting documentation edits
Follow these steps to suggest edits on a documentation page. Make sure you are on the page for which you want to suggest...
Read more >
Automatic Detection and Update Suggestion for Outdated API ...
In this paper, we propose a method for automatically updating outdated API names in API documentation. Our insight is that API updates in ......
Read more >
Quickstart guide | Suggested documentation
Lastly, when you've deployed a new product update, you can write a changelog post. This is like a a blog post where you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found