CLI previewInstall commands shown on this site are not released yet.

DocsChartsCore charts

AreaChart

React example follows below.
ts
import { AreaChart } from "@grassroot/charts-react";
const monthLabels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
<AreaChart animation={{ durationMs: 640, staggerMs: 32 }} ariaLabel="Cumulative signups, year to date" tooltip crosshair legend={{ position: "top" }} data={[5, 9, 14, 18, 26, 33, 39, 48, 57, 63, 72, 80]} labels={monthLabels} max={88} />
ts
<script setup lang="ts">
import { AreaChart } from "@grassroot/charts-vue";
const monthLabels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
</script>
<template>
<AreaChart :animation='{ durationMs: 640, staggerMs: 32 }' ariaLabel="Cumulative signups, year to date" tooltip crosshair :legend='{ position: "top" }' :data='[5, 9, 14, 18, 26, 33, 39, 48, 57, 63, 72, 80]' :labels='monthLabels' :max='88' />
</template>
ts
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootAreaChart } from "@grassroot/charts-angular";
@Component({
selector: "app-area-chart-chart-demo",
standalone: true,
imports: [GrassrootAreaChart],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<grassroot-area-chart [animation]='{ durationMs: 640, staggerMs: 32 }' ariaLabel="Cumulative signups, year to date" tooltip crosshair [legend]='{ position: "top" }' [data]='[5, 9, 14, 18, 26, 33, 39, 48, 57, 63, 72, 80]' [labels]='monthLabels' [max]='88' />`,
})
export class AreaChartDemoComponent {
readonly monthLabels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
}
export default AreaChartDemoComponent;
ts
<script lang="ts">
import { AreaChart } from "@grassroot/charts-svelte";
const monthLabels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
</script>
<AreaChart animation={{ durationMs: 640, staggerMs: 32 }} ariaLabel="Cumulative signups, year to date" tooltip crosshair legend={{ position: "top" }} data={[5, 9, 14, 18, 26, 33, 39, 48, 57, 63, 72, 80]} labels={monthLabels} max={88} />
ts
/** @jsxImportSource solid-js */
import { AreaChart } from "@grassroot/charts-solid";
const monthLabels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
export default function AreaChartDemo() {
return <AreaChart animation={{ durationMs: 640, staggerMs: 32 }} ariaLabel="Cumulative signups, year to date" tooltip crosshair legend={{ position: "top" }} data={[5, 9, 14, 18, 26, 33, 39, 48, 57, 63, 72, 80]} labels={monthLabels} max={88} />;
}

Installation

bash
pnpm dlx grassroot add chart/area-chart
bash
npx grassroot@latest add chart/area-chart
bash
yarn dlx grassroot add chart/area-chart
bash
bunx grassroot add chart/area-chart

API Reference

AreaChartProps
PropTypeDefault
datarequirednumber[] | { x: number | Date | string; y: number | null | undefined; label?: string; }[]
labelsstring[] | undefined
maxnumber | undefined
colorstring | undefined
xDomainChartNumericDomain | ChartTimeDomain | undefined
yDomainChartNumericDomain | undefined
xAxisChartAxisOptions<number | Date> | undefined
yAxisChartAxisOptions<number> | undefined
showGridboolean | undefined
formatXTick((value: number | Date, index: number) => string) | undefined
formatYTick((value: number, index: number) => string) | undefined