如何添加Angular 2中的融合图表的许可证密钥2

发布于 2025-01-23 02:34:43 字数 246 浏览 4 评论 0原文

如Fusion Charts文档中所述,它不适用于Angular。如何为角度项目实施此功能?

fusion图表许可证

fusionCharts.options.license.license({{ 钥匙: '', Credit Label:false, });

As explained here in fusion charts documentation, it doesn't work for angular. How can I implement this for the angular projects?

Fusion chart license

FusionCharts.options.license({
key: '',
creditLabel: false,
});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

感性 2025-01-30 02:34:43

中使用以下代码

请在您的app.module.ts fusionCharts.options ['license'] ({{
钥匙: '',
Credit Label:false,
});

NB:如果发生错误,请检查您的tsconfig.json,并删除严格:true选项。

谢谢

Please use the below code into your app.module.ts

FusionCharts.options['license']({
key: '',
creditLabel: false,
});

NB:If Still error occurs the please check your tsconfig.json and trun off the strict : true option.

Thanks

兮子 2025-01-30 02:34:43

您可以尝试使用以下步骤使用FusionCharts的许可版本:

  1. 在您的项目root或其他地方创建一个名为FusionCharts的文件夹,并将FusionCharts许可版本的库模块文件复制到该文件夹​​中。

  2. 安装Angular2-FusionCharts包装器:

    NPM安装Angular2-FusionCharts-Save

安装Angular2-FusionCharts之后,将其导入到Angular AppModule中,如下所示:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FusionChartsModule } from 'angular4-fusioncharts';
import * as FusionCharts from './fusioncharts';
import * as Charts from './fusioncharts/fusioncharts.charts';
import * as FintTheme from './fusioncharts/themes/fusioncharts.theme.fint';
import { AppComponent } from './app.component';
FusionChartsModule.fcRoot(FusionCharts, Charts, FintTheme);
@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        FusionChartsModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule {}

一旦导入库后,您可以在Angular Application中使用此组件:

在Angular Apponponement中 : :

import { Component } from '@angular/core';
    @Component({
        selector: 'app-root',
        templateUrl: './app.component.html'
    })
    export class AppComponent {
        id = 'chart1';
        width = 600;
        height = 400;
        type = 'column2d';
        dataFormat = 'json';
        dataSource;
        title = 'Angular4 FusionCharts Sample';
        constructor() {
            this.dataSource = {
                "chart": {
                    "caption": "Harry's SuperMart",
                    "subCaption": "Top 5 stores in last month by revenue",
                    "numberprefix": "$",
                    "theme": "fint"
                },
                "data": [
                    {
                        "label": "Bakersfield Central",
                        "value": "880000"
                    },
                    {
                        "label": "Garden Groove harbour",
                        "value": "730000"
                    },
                    {
                        "label": "Los Angeles Topanga",
                        "value": "590000"
                    },
                    {
                        "label": "Compton-Rancho Dom",
                        "value": "520000"
                    },
                    {
                        "label": "Daly City Serramonte",
                        "value": "330000"
                    }
                ]
            }
        }
    }

现在,您可以在app.component.html模板中使用组件:

<h1>
  {{title}}
</h1>
<fusioncharts
    [width]="width"
    [height]="height"
    [type]="type"
    [dataFormat]="dataFormat"
    [dataSource]="dataSource"
></fusioncharts>

检查此文档 - “ nofollow noreferrer”> https://www.fusioncharts.com/dev/upgrading/license-activation

You can try with the below steps to use your licensed version of FusionCharts:

  1. Create a folder named fusioncharts in your project root or elsewhere and copy the library module files of your licensed version of FusionCharts into that folder.

  2. Install the angular2-fusioncharts wrapper:

    npm install angular2-fusioncharts --save

After installing angular2-fusioncharts, import it in your Angular AppModule as follows:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FusionChartsModule } from 'angular4-fusioncharts';
import * as FusionCharts from './fusioncharts';
import * as Charts from './fusioncharts/fusioncharts.charts';
import * as FintTheme from './fusioncharts/themes/fusioncharts.theme.fint';
import { AppComponent } from './app.component';
FusionChartsModule.fcRoot(FusionCharts, Charts, FintTheme);
@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        FusionChartsModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule {}

Once the library is imported, you can use this component in your Angular application:

In your Angular AppComponent:

import { Component } from '@angular/core';
    @Component({
        selector: 'app-root',
        templateUrl: './app.component.html'
    })
    export class AppComponent {
        id = 'chart1';
        width = 600;
        height = 400;
        type = 'column2d';
        dataFormat = 'json';
        dataSource;
        title = 'Angular4 FusionCharts Sample';
        constructor() {
            this.dataSource = {
                "chart": {
                    "caption": "Harry's SuperMart",
                    "subCaption": "Top 5 stores in last month by revenue",
                    "numberprefix": "
quot;,
                    "theme": "fint"
                },
                "data": [
                    {
                        "label": "Bakersfield Central",
                        "value": "880000"
                    },
                    {
                        "label": "Garden Groove harbour",
                        "value": "730000"
                    },
                    {
                        "label": "Los Angeles Topanga",
                        "value": "590000"
                    },
                    {
                        "label": "Compton-Rancho Dom",
                        "value": "520000"
                    },
                    {
                        "label": "Daly City Serramonte",
                        "value": "330000"
                    }
                ]
            }
        }
    }

Now, You can use component in your app.component.html template:

<h1>
  {{title}}
</h1>
<fusioncharts
    [width]="width"
    [height]="height"
    [type]="type"
    [dataFormat]="dataFormat"
    [dataSource]="dataSource"
></fusioncharts>

Check this document - https://www.fusioncharts.com/dev/upgrading/license-activation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文