averouiComponent playgroundv0.0.1

Chart

New

Bring data into focus with responsive charts powered by Chart.js.

12 examplesLive dataAccessible tables

Basic

Select a bar to inspect revenue, click a legend to toggle its series, or update the data.

Quarterly revenue

Select a bar to inspect its value.

View data table
Quarterly revenue
QuarterRevenue
Q142
Q258
Q373
Q491

Pie

Compare the contribution of each traffic source.

Pie chart
View data table
Pie data
CategoryVisits
Direct35
Search30
Social20
Email15

Doughnut

The same proportions with a hollow center.

Doughnut chart
View data table
Doughnut data
CategoryVisits
Direct35
Search30
Social20
Email15

Vertical Bar

Compare online and retail sales across six months.

Vertical Bar chart
View data table
Vertical Bar data
CategoryOnlineRetail
January4532
February6240
March5448
April7852
May8661
June9868

Horizontal Bar

Place categories on the vertical axis with indexAxis: y.

Horizontal Bar chart
View data table
Horizontal Bar data
CategoryOnlineRetail
January4532
February6240
March5448
April7852
May8661
June9868

Stacked Bar

Combine both sales channels into a monthly total.

Stacked Bar chart
View data table
Stacked Bar data
CategoryOnlineRetail
January4532
February6240
March5448
April7852
May8661
June9868

Line

Track the evolution of both sales channels.

Line chart
View data table
Line data
CategoryOnlineRetail
January4532
February6240
March5448
April7852
May8661
June9868

MultiAxis

Show revenue and conversion rate using independent axes.

MultiAxis chart
View data table
MultiAxis data
CategoryRevenueConversion (%)
January452.4
February623.1
March542.8
April783.9
May864.2
June984.8

Line Styles

Use filled areas, curves and dashed lines to distinguish series.

Line Styles chart
View data table
Line Styles data
CategoryActualTarget
January4550
February6260
March5470
April7880
May8690
June98100

Polar Area

Equal angles with radii proportional to the traffic share.

Polar Area chart
View data table
Polar Area data
CategoryVisits
Direct35
Search30
Social20
Email15

Radar

Compare two teams across five skills.

Radar chart
View data table
Radar data
CategoryTeam ATeam B
Design8570
Delivery7288
Quality9075
Support7882
Research6592

Combo

Combine a line target and monthly bars in one chart.

Combo chart
View data table
Combo data
CategoryTargetRevenue
January5045
February6062
March7054
April8078
May9086
June10098

Usage

Install Chart.js 4.5 or newer in your application, then import AvChart into your standalone component.

npm install chart.js
import { AvChart, AvChartData, AvChartOptions } from 'avero-ui';

data: AvChartData = {
  labels: ['Q1', 'Q2', 'Q3', 'Q4'],
  datasets: [{ label: 'Revenue', data: [42, 58, 73, 91] }]
};
options: AvChartOptions = { scales: { y: { beginAtZero: true } } };

<av-chart type="bar" [data]="data" [options]="options"
  height="320px" ariaLabel="Quarterly revenue"
  (onDataSelect)="select($event)" />

API and accessibility

Inputs: type, data, options, plugins, responsive (true), width (100%), height (320px), ariaLabel, ariaLabelledBy and ariaDescribedBy. The type, datasets, options and plugins use Chart.js types and support mixed datasets.

Replace data or options to update a chart automatically. Call refresh() after in-place edits, reinit() to recreate the chart, resize() after layout changes, or update(mode) after changing the instance returned by getChart(). clear() clears the canvas; getCanvas() returns the canvas and getBase64Image() returns its current image after initialization.

Outputs: onReady provides the Chart.js instance; onDataSelect provides originalEvent, element, datasetIndex and index; onError reports loading or rendering failures. Existing options.onClick callbacks are preserved. Options default to maintainAspectRatio: false; responsive is controlled by the component input.

Charts initialize only in the browser after rendering. Data and plain options are copied before Chart.js receives them; custom plugins retain their identity. Instances and observers are released when the component is destroyed.

Canvas content does not provide keyboard access to individual data points. Supply a descriptive label and a data table or text alternative, as in these examples. Projected content appears below the canvas and is also available during SSR. Use options.animation: false when animation is unsuitable.