Angular UI Components Documentation
The Angular Chart draws more than 30 chart types, among them line, area, bar, pie, donut, range, financial, polar and spider charts, as SVG or HTML5 Canvas. This guide adds the Angular Chart (jqxChart) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxchart 
In an Angular project (to start one, see Getting started with Angular), add the package with the Angular CLI. It asks for a theme and adds the styles to angular.json:
ng add jqwidgets-ng
Components are standalone: add jqxChartModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxChartModule } from 'jqwidgets-ng/jqxchart';
@Component({
selector: 'app-root',
imports: [jqxChartModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Column Series with Local Data demo.
<jqxChart
[width]="getWidth()" [height]="500"
[title]="'Fitness & exercise weekly scorecard'"
[description]="'Time spent in vigorous exercise'"
[showLegend]="true" [enableAnimations]="true" [padding]="padding"
[titlePadding]="titlePadding" [source]="sampleData" [xAxis]="xAxis"
[seriesGroups]="seriesGroups" [colorScheme]="'scheme01'">
</jqxChart>
import { Component } from '@angular/core';
import { jqxChartModule } from 'jqwidgets-ng/jqxchart';
import { CommonModule } from '@angular/common';
@Component({
imports: [jqxChartModule, CommonModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {
sampleData: any[] = [
{ Day: 'Monday', Keith: 30, Erica: 15, George: 25 },
{ Day: 'Tuesday', Keith: 25, Erica: 25, George: 30 },
{ Day: 'Wednesday', Keith: 30, Erica: 20, George: 25 },
{ Day: 'Thursday', Keith: 35, Erica: 25, George: 45 },
{ Day: 'Friday', Keith: 20, Erica: 20, George: 25 },
{ Day: 'Saturday', Keith: 30, Erica: 20, George: 30 },
{ Day: 'Sunday', Keith: 60, Erica: 45, George: 90 }
];
getWidth(): any {
if (document.body.offsetWidth < 850) {
return '90%';
}
return 850;
}
padding: any = { left: 5, top: 5, right: 5, bottom: 5 };
titlePadding: any = { left: 90, top: 0, right: 0, bottom: 10 };
xAxis: any = { dataField: 'Day', showGridLines: true };
seriesGroups: any[] = [
{
type: 'column',
columnsGapPercent: 50,
seriesGapPercent: 0,
valueAxis: {
unitInterval: 10,
minValue: 0,
maxValue: 100,
displayValueAxis: true,
description: 'Time in minutes',
axisSize: 'auto',
tickMarksColor: '#888888'
},
series: [
{ dataField: 'Keith', displayText: 'Keith' },
{ dataField: 'Erica', displayText: 'Erica' },
{ dataField: 'George', displayText: 'George' }
]
}
];
}
Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, click: The event is raised when the user clicks on series element.
<jqxChart (onClick)="onClick($event)"></jqxChart>
onClick(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, refresh:
<jqxChart #myChart></jqxChart>
import { Component, viewChild } from '@angular/core';
import { jqxChartModule, jqxChartComponent } from 'jqwidgets-ng/jqxchart';
@Component({
selector: 'app-root',
imports: [jqxChartModule],
templateUrl: './app.html'
})
export class App {
readonly myChart = viewChild.required<jqxChartComponent>('myChart');
run(): void {
this.myChart().refresh();
}
}