diff --git a/docs/en/UI/Angular/Chart-Component.md b/docs/en/UI/Angular/Chart-Component.md index d165261e18..e2bf2c2e1e 100644 --- a/docs/en/UI/Angular/Chart-Component.md +++ b/docs/en/UI/Angular/Chart-Component.md @@ -11,8 +11,8 @@ First of all, need to import the `ChartModule` to your feature module as follows ```ts // your-feature.module.ts -import { ChartModule } from '@abp/ng.components/chart.js'; -import { ChartDemoComponent } from './chart-demo.component'; +import { ChartModule } from "@abp/ng.components/chart.js"; +import { ChartDemoComponent } from "./chart-demo.component"; @NgModule({ imports: [ @@ -30,20 +30,20 @@ Then, `abp-chart` component can be used. See an example: ```ts // chart-demo.component.ts -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-chart-demo', + selector: "app-chart-demo", template: ` `, }) export class ChartDemoComponent { data = { - labels: ['Data 1', 'Data 2', 'Data 3'], + labels: ["Data 1", "Data 2", "Data 3"], datasets: [ { - label: 'Dataset 1', + label: "Dataset 1", data: [40, 15, 45], - backgroundColor: ['#ff7675', '#fdcb6e', '#0984e3'], + backgroundColor: ["#ff7675", "#fdcb6e", "#0984e3"], }, ], }; @@ -61,10 +61,10 @@ See the result: ### Doughnut ```ts -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-chart-demo', + selector: "app-chart-demo", template: ` `, }) export class ChartDemoComponent { data = { - labels: ['Data 1', 'Data 2', 'Data 3'], + labels: ["Data 1", "Data 2", "Data 3"], datasets: [ { - label: 'Dataset 1', + label: "Dataset 1", data: [40, 15, 45], - backgroundColor: ['#a0e6c3', '#f0ea4c', '#5b9dc3'], + backgroundColor: ["#a0e6c3", "#f0ea4c", "#5b9dc3"], }, ], }; @@ -91,14 +92,22 @@ export class ChartDemoComponent { plugins: { title: { display: true, - text: 'Doughnut Chart', + text: "Doughnut Chart", fontSize: 16, }, legend: { - position: 'bottom', + position: "bottom", }, }, }; + + myPlugin = [ + { + afterRender: (chart, args, options) => { + console.log("chart has been rendered"); + }, + }, + ]; } ``` @@ -109,10 +118,10 @@ Result: ### Bar ```ts -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-chart-demo', + selector: "app-chart-demo", template: `