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

DocsChartsCore charts

BarChart

React example follows below.
ts
import { BarChart } from "@grassroot/charts-react"; <BarChart animation={{ durationMs: 520, staggerMs: 48 }} ariaLabel="Requests by region, last 7 days" tooltip legend={{ position: "top" }} data={[{ label: "us-east", value: 82 }, { label: "us-west", value: 64 }]} max={90} />
ts
<script setup lang="ts">
import { BarChart } from "@grassroot/charts-vue";
</script>
<template>
<BarChart :animation='{ durationMs: 520, staggerMs: 48 }' ariaLabel="Requests by region, last 7 days" tooltip :legend='{ position: "top" }' :data='[{ label: "us-east", value: 82 }, { label: "us-west", value: 64 }]' :max='90' />
</template>
ts
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootBarChart } from "@grassroot/charts-angular";
@Component({
selector: "app-bar-chart-chart-demo",
standalone: true,
imports: [GrassrootBarChart],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<grassroot-bar-chart [animation]='{ durationMs: 520, staggerMs: 48 }' ariaLabel="Requests by region, last 7 days" tooltip [legend]='{ position: "top" }' [data]='[{ label: "us-east", value: 82 }, { label: "us-west", value: 64 }]' [max]='90' />`,
})
export class BarChartDemoComponent {
}
export default BarChartDemoComponent;
ts
<script lang="ts">
import { BarChart } from "@grassroot/charts-svelte";
</script>
<BarChart animation={{ durationMs: 520, staggerMs: 48 }} ariaLabel="Requests by region, last 7 days" tooltip legend={{ position: "top" }} data={[{ label: "us-east", value: 82 }, { label: "us-west", value: 64 }]} max={90} />
ts
/** @jsxImportSource solid-js */
import { BarChart } from "@grassroot/charts-solid";
export default function BarChartDemo() {
return <BarChart animation={{ durationMs: 520, staggerMs: 48 }} ariaLabel="Requests by region, last 7 days" tooltip legend={{ position: "top" }} data={[{ label: "us-east", value: 82 }, { label: "us-west", value: 64 }]} max={90} />;
}

Installation

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

API Reference

BarChartProps
PropTypeDefault
datarequiredChartCategoricalDatum[]
maxnumber | undefined
colorstring | undefined
yDomainChartNumericDomain | undefined
xAxisChartAxisOptions<string> | undefined
yAxisChartAxisOptions<number> | undefined
showGridboolean | undefined
formatXTick((value: string, index: number) => string) | undefined
formatYTick((value: number, index: number) => string) | undefined