Open anup-kubade opened 8 years ago
Unfortunately I don't have ideas how it is possible to provide highcharts only and highstock as an optional module like the map or other highcharts modules. The root of this problem is how original highcharts CommonJS modules presented: http://www.highcharts.com/docs/getting-started/install-from-npm. So probably it makes sense to create issue here https://github.com/highcharts/highcharts/issues so they move highstock to a module.
As long your not using highcstock charts you are in no problems (though i would advice asking Highcharts about that to be extra sure).
Also on same note, https://github.com/gevgeny/angular2-highcharts/blob/master/src/Highcharts.ts#L4 this binding to Highstocks.src.js can be exchanged to just Highcharts.src.js? That is if not using any Highstocks functionality?
Also on same note, https://github.com/gevgeny/angular2-highcharts/blob/master/src/Highcharts.ts#L4 this binding to Highstocks.src.js can be exchanged to just Highcharts.src.js? That is if not using any Highstocks functionality?
Yes, i think it would work, you can do it in your local repo.
It worked but i havent used charts extensively so wasnt sure if some part is dependant onto it.
You can use webpack to override specific modules.
Really I'd rather have support for passing in a configured Highcharts instance
Could you give an example on how that would look in webpack config @graingert ? I'm new to webpack.
create an injectable stub service:
@Injectable()
export class AsyncHighchartsService {
async getHighcharts(): void {} //stub
}
Then depend on it from your component.
Then export two version of the component in default modules, in index (import angular2-highcharts
), export a version that provides a hard coded AsyncHighchartsService implementation that pull it out via an import statement, and another module on angular2-highcharts/custom
that leaves the implementation up to the user
then a user can replace the getHighcharts async method with a static import of highstock/highcharts whatever they choose, or they can async load it via a webpack chunks, or they can async load using whatever too they want.
We have observed that the angular2-highcharts library uses highstock internally, as it supports Highcharts and Highstock both. But we have only license for Highcharts library. So is there any way to exclude highstock library while using angular2-highcharts?