简体   繁体   English

highchart:创建库存图表

[英]highchart : create stock chart

I'm creating a stock chart in highcharts. 我正在用图表绘制股票图表。

But it gives an error in .ts file 但它在.ts文件中给出错误

ie

ERROR in src/app/dionaea/dionaea.component.ts(313,23): error TS2339: Property 'stockChart' does not exist on type 'Static'. src / app / dionaea / dionaea.component.ts(313,23)中的错误:错误TS2339:“静态”类型上不存在属性“ stockChart”。

Can anyone have solution of this error. 任何人都可以解决此错误。

Highcharts.stockChart('conPerDateGraph', {
    rangeSelector: {
        selected: 1
    },

    title: {
        text: 'AAPL Stock Price'
    },

    series: [{
        name: 'AAPL',
        data: data,
        tooltip: {
            valueDecimals: 2
        }
    }]
});

highstock.d.ts currently doesn't define any exports as such, thats the reason your getting complie error while using StockChart property. highstock.d.ts当前没有这样定义任何导出,这就是使用StockChart属性时出现compile错误的原因。 Modify highstock.d.ts to define extra exports as shown below: 修改highstock.d.ts以定义额外的出口,如下所示:

declare var Highstock: __Highstock.Static;
export = Highstock;
export as namespace Highstock;

In your my TS file you can use it like this: 在我的TS文件中,您可以像这样使用它:

import * as Highstock from "highcharts/highstock";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM