如何将Angular Highcharts添加到我的Angular项目中? [英] How add Angular Highcharts to my angular project?

查看:60
本文介绍了如何将Angular Highcharts添加到我的Angular项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我愿意

npm install highcharts-angular --save
npm install highcharts --save

然后将其添加到app.module.ts

and I add this to app.module.ts

import { HighchartsChartModule } from 'highcharts-angular';

@NgModule({
imports: [
...
HighchartsChartModule

,然后将其添加到我的component.ts中:

and I add this to my component.ts:

import * as Highcharts from 'highcharts';
Highcharts: typeof Highcharts = Highcharts;
chartOptions: Highcharts.Options = {
series: [
  {
    type: 'line',
    pointInterval: 24 * 3600 * 1000,
    data: [1, 2, 3, 4, 5]
  }
]

};

然后在HTML文件中添加此

and in the HTML file I add this

<highcharts-chart [Highcharts]="Highcharts" [options]="chartOptions" style="width: 100%; height:400px; display: block;"></highcharts-chart>

但什么也没出现

推荐答案

您能否点击下面的链接.从我的角度来看一切正常

Could you follow below link. It's working fine from my side

https://stackblitz.com/edit/angular-hsodq9

这篇关于如何将Angular Highcharts添加到我的Angular项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆