5.0.0 • Published 11 months ago

@odx/angular-chart-js v5.0.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
11 months ago

ChartJS

Install

npm install @odx/angular-chart-js

Import the Charts CSS theme file @import '@odx/ui/core/charts-theme.css' from @odx/ui;

Usage

Add provideChartsTheme() from @odx/angular-chart-js to the providers to set the ODX color palette for your charts.

Similar to provideCharts() from ng2-charts, this provider sets configuration options for ODX charts. It offers a range of customizable settings and styles to create visually appealing and interactive charts. For more details, refer to the ng2-charts documentation. Additionally, this provider responds to changes in the ODX theme.

You can also provide custom configurations:

import { withDefaultRegisterables } from 'ng2-charts';
import { provideChartsTheme } from '@odx/angular-chart-js';

bootstrapApplication(AppComponent, {
  providers: [
    provideChartsTheme(withDefaultRegisterables(), {
      defaults: {
        font: { family: 'Verdana' },
        backgroundColor: '#297f31',
      },
    }),
  ],
}).catch((err) => console.error(err));

Use BaseChartDirective:

<canvas baseChart [data]="yourChartData" type="yourChartType"></canvas>

Live demo

Please refer to our Storybook, to see sample charts.

4.0.1

1 year ago

4.0.0

1 year ago

5.0.0

11 months ago

4.0.2

1 year ago

3.0.0

1 year ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago