Free
Pro

Chart

Native SVG charts for dashboards — bar, horizontal bar, stacked bar, line, area, donut, pie, and compact sparklines. No third-party chart library required. Fully styled for light and dark mode. Lazy-load below the fold with @defer and the @defer cookbook.

Pronew@defer

Pro — licensed

Chart — part of Ply Pro

Unlock it plus 92 pro blocks, widgets & layouts — $99 one-time. Lifetime updates, 14-day money-back guarantee.

Unlock Pro

Bar chart

Pass [data] as an array of label / value points. The tallest bar is highlighted automatically.

Line chart

fillArea fills under this line. type="area" is the same fill without the extra flag. showGrid draws the guides.

Donut chart

Segments cycle the semantic palette. Set centerLabel and optional centerValue for the inner caption.

Customers100
  • Starter(24%)
  • Pro(46%)
  • Team(18%)
  • Enterprise(12%)

Area, horizontal, stacked, and pie

area fills under the line. horizontal-bar draws categories down the side. stacked-bar reads segments on each point. pie is a donut with no hole.

  • New
  • Returning
  • Starter(24%)
  • Pro(46%)
  • Team(18%)
  • Enterprise(12%)

Sparkline

Minimal inline trend line — ideal inside stat cards or cells.

Active sessions

1,284

+8.2%

Installation

Run the following command to add this component to your project:

bash
npx ply-ui-cli add chart

API Reference

For AI agents

Copy a prompt with the registry name, CLI install, and import — or add the Ply MCP server.

bash
npx -y ply-ui-mcp

Ply provides standalone components. Import the exact elements you want to use into your component.

typescript (Example)
// Install: npx ply-ui-cli add chart
// Paths are relative to aliases.components (default: src/app/components)
import { ChartComponent } from './chart/chart.component';

@Component({
  selector: 'app-your-component',
  imports: [
    ChartComponent
  ],
  template: `...`
})
export class YourComponent {}

API for chart — generated from JSDoc in the library source.

API reference for chart
APIMemberTypeDefaultDescription
ply-chartclassstring''Extra host classes merged via `cn()`.
ply-charttypeChartType'bar'Chart visualization type.
ply-chartdataChartDataPoint[][]Series data points.
ply-chartcolorChartColor'primary'Default series color when points do not specify their own.
ply-chartheightnumberCHART_HEIGHTPlot height in pixels (bar, line, donut). Sparkline uses a fixed compact height.
ply-chartshowLabelsbooleantrueShows category labels under bar charts and on the x-axis for line charts.
ply-chartshowGridbooleantrueShows horizontal grid lines on line charts.
ply-chartshowLegendbooleantrueShows a color legend below donut charts.
ply-chartfillAreabooleanfalseFills the area under a line chart.
ply-chartcenterLabelstring''Center caption on donut charts (e.g. "Total").
ply-chartcenterValuestring''Center value on donut charts. Defaults to the sum of segment values.
ply-chartariaLabelunknown'Chart'Accessible name announced to assistive tech.