首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >角2-高度图支持角11吗?

角2-高度图支持角11吗?
EN

Stack Overflow用户
提问于 2021-05-16 04:52:54
回答 1查看 188关注 0票数 1

我在用https://github.com/gevgeny/angular2-highcharts

代码语言:javascript
复制
npm i angular2-highcharts

它非常好,直到我的源代码环境是角8,但升级到角11后,它并不像预期的那样工作。我在HighchartsStatic上发现了注射器的错误。

下面是我的代码片段:

代码语言:javascript
复制
import { HighchartsStatic } from 'angular2-highcharts/dist/HighchartsService';

export function highchartsFactory() {
   const hc = require( 'highcharts/highstock' );
    const dd = require( 'highcharts/modules/exporting' );

    hc.setOptions( {
        lang: {
            numericSymbols: [" K", " M", " B", " T", " P", " E"],
            thousandsSep: ",",
            decimalPoint: ".",
            stockTools: {
                gui: {
                    inputText: 'Text annotation from input'
                }
            },
            navigation: {
                popup: {
                    inputText: 'Input text'
                }
            }
        },
        tooltip: {
            xDateFormat: '%m/%d/%Y',
            valueDecimals: 2 
        },
        time: {
            timezoneOffset: (new Date()).getTimezoneOffset() 
        },
        global: {
            timezoneOffset: (new Date()).getTimezoneOffset()
        }
    } );
    
    dd( hc );
    // const annotations = require('highcharts-annotations/js/annotations');
    // annotations(hc);
    const ind = require( 'highcharts/indicators/indicators-all' );
    ind( hc );
    const annotationsAdvanced = require( './highcharts/modules/annotations-advanced.src' );
    annotationsAdvanced( hc );
    const priceIndicators = require( 'highcharts/modules/price-indicator' );
    priceIndicators( hc );
    const fullScreen = require( 'highcharts/modules/full-screen' );
    fullScreen( hc );
    const stockTools = require( 'highcharts/modules/stock-tools' );
    stockTools( hc );
    const dragPanes = require( 'highcharts/modules/drag-panes' );
    dragPanes( hc );
    const boost = require( 'highcharts/modules/boost' );
    boost( hc );
    
    return hc;
}

我的单元是:

代码语言:javascript
复制
@NgModule( {
    providers: [{
                  provide: HighchartsStatic,
                  useFactory: highchartsFactory
                }]
})

我浏览了许多博客,他们建议使用高图表-角,但这将是一个重大的变化,我的项目。有什么办法可以用它或者解决这个问题吗?

另外,我想知道angular2-highcharts的角度支撑

EN

回答 1

Stack Overflow用户

发布于 2021-05-16 07:02:03

highcharts-angular是“角”的官方高级图表包装器,因此从angular2-highcharts切换到highcharts-angular将是一项很好的长期投资。

从npm下载统计数据可以清楚地看出,highcharts-angular更受欢迎(每周下载55k次,每周下载5k次)。

cleary说在github回购中不再支持。考虑使用角的高级图表包装器

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67553291

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档