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

DocsChartsRadial & KPI

BulletChart

React example follows below.
ts
import { BulletChart } from "@grassroot/charts-react";
const values = [
{ label: "Acquisition", value: 42, color: "var(--accent)" },
{ label: "Activation", value: 28, color: "var(--vs-success)" },
{ label: "Retention", value: 18, color: "var(--vs-warning)" },
];
<BulletChart value={68} target={75} ranges={values} />
ts
<script setup lang="ts">
import { BulletChart } from "@grassroot/charts-vue";
const values = [
{ label: "Acquisition", value: 42, color: "var(--accent)" },
{ label: "Activation", value: 28, color: "var(--vs-success)" },
{ label: "Retention", value: 18, color: "var(--vs-warning)" },
];
</script>
<template>
<BulletChart :value='68' :target='75' :ranges='values' />
</template>
ts
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootBulletChart } from "@grassroot/charts-angular";
@Component({
selector: "app-bullet-chart-chart-demo",
standalone: true,
imports: [GrassrootBulletChart],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<grassroot-bullet-chart [value]='68' [target]='75' [ranges]='values' />`,
})
export class BulletChartDemoComponent {
readonly values = [
{ label: "Acquisition", value: 42, color: "var(--accent)" },
{ label: "Activation", value: 28, color: "var(--vs-success)" },
{ label: "Retention", value: 18, color: "var(--vs-warning)" },
];
}
export default BulletChartDemoComponent;
ts
<script lang="ts">
import { BulletChart } from "@grassroot/charts-svelte";
const values = [
{ label: "Acquisition", value: 42, color: "var(--accent)" },
{ label: "Activation", value: 28, color: "var(--vs-success)" },
{ label: "Retention", value: 18, color: "var(--vs-warning)" },
];
</script>
<BulletChart value={68} target={75} ranges={values} />
ts
/** @jsxImportSource solid-js */
import { BulletChart } from "@grassroot/charts-solid";
const values = [
{ label: "Acquisition", value: 42, color: "var(--accent)" },
{ label: "Activation", value: 28, color: "var(--vs-success)" },
{ label: "Retention", value: 18, color: "var(--vs-warning)" },
];
export default function BulletChartDemo() {
return <BulletChart value={68} target={75} ranges={values} />;
}

Installation

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

API Reference

BulletChartProps
PropTypeDefault
valuerequirednumber
targetnumber | undefined
rangesreadonly ChartValueDatum[] | undefined