Encharting is an Angular library designed to simplify the process of 2D charts generation.
After creating a new Angular project simply run:
npm install encharting --save
-
Firstly, import EnchartingDirective in your app module (or any other proper Angular Module, Standalone Components also work).
import { EnchartingDirective } from 'encharting'; @NgModule({ imports: [ EnchartingDirective ], }) export class AppModule {}
-
Then use the encharting directive in the HTML of your Angular component:
<div encharting></div>
Name | Type | Default | Description |
---|---|---|---|
@Input [config] | Chart | { components: [] } | The chart configuration object |
@Input [width] | string | 600px | The width of the canvas element (use same css values) |
@Input [height] | string | 400px | The height of the canvas element (use same css values) |
@Input [theme] | EnchartingTheme | undefined | The theme of the chart |
@Input [fontFamily] | string | The Font Family of the chart |
Name | Type | Description |
---|---|---|
@Output (onClick) | ECElementEvent | Emits an ECElementEvent object when clicking on a component of the chart (for example a point of a line) |
@Output (onBlankClick) | BasePoint | Emits a BasePoint object when clicking on a blank space of the chart |