Is there any way to use highcharts.js with angular2 ?Is there any option available instead of highcharts?
相关问题
- Angular RxJS mergeMap types
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- How to update placeholder text in ng2-smart-table?
- How to instantiate Http service in main.ts manuall
- Angular: ngc or tsc?
相关文章
- angular脚手架在ie9+下兼容问题
- angular 前端项目 build 报错 "Cannot find module 'le
- Angular Material Stepper causes mat-formfield to v
- After upgrade to Angular 9 cannot find variable in
- is there any difference between import { Observabl
- Suppress “Circular dependency detected” suppress w
- How can you get current positional information abo
- Angular material table not showing data
Added this to package.json:
Added this on main.module.ts file:
Added this on main.module.ts in @NgModule imports section
Added this in vendor.ts file:
Added this on the chart.component.ts file
declare this on inside the chart.component class code:
Add this code in the method that binds the data to the chart:
Added this on the chart.component.html page:
You could also try angular2-highcharts I implemented.
To install this library, install peer dependencies first:
Also, make sure you install the typings for Highcharts:
Then, install this library running:
I think that you could try ng2-highchart (https://github.com/Bigous/ng2-highcharts).
See this project for a sample of use: https://github.com/Bigous/angular2-seed-ng2-highcharts.
How to set it up in SystemJS configuration: https://github.com/Bigous/angular2-seed-ng2-highcharts/blob/master/src/index.html#L43 and https://github.com/Bigous/angular2-seed-ng2-highcharts/blob/master/tools/config.ts#L108
How to configure it within a component: https://github.com/Bigous/angular2-seed-ng2-highcharts/blob/master/src/home/components/home.ts#L10
How to use it within a component template: https://github.com/Bigous/angular2-seed-ng2-highcharts/blob/master/src/home/components/home.html#L9
I didn't tested yet but HighCharts has its official Angular library which seems to be actively maintained.
Try this approach without need of 3rd party library.
And put down this to index.html
Or try this module http://ngmodules.org/modules/angular2-highcharts, if you need to handle on point select event.