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

DocsChartsCartesian & statistical

WaterfallChart

React example follows below.
ts
import { WaterfallChart } from "@grassroot/charts-react";
<WaterfallChart data={[{ label: "start", value: 20 }, { label: "expansion", value: 8 }, { label: "churn", value: -5 }, { label: "net", value: 23, kind: "total" }]} />
ts
<script setup lang="ts">
import { WaterfallChart } from "@grassroot/charts-vue";
</script>
<template>
<WaterfallChart :data='[{ label: "start", value: 20 }, { label: "expansion", value: 8 }, { label: "churn", value: -5 }, { label: "net", value: 23, kind: "total" }]' />
</template>
ts
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootWaterfallChart } from "@grassroot/charts-angular";
@Component({
selector: "app-waterfall-chart-chart-demo",
standalone: true,
imports: [GrassrootWaterfallChart],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<grassroot-waterfall-chart [data]='[{ label: "start", value: 20 }, { label: "expansion", value: 8 }, { label: "churn", value: -5 }, { label: "net", value: 23, kind: "total" }]' />`,
})
export class WaterfallChartDemoComponent {
}
export default WaterfallChartDemoComponent;
ts
<script lang="ts">
import { WaterfallChart } from "@grassroot/charts-svelte";
</script>
<WaterfallChart data={[{ label: "start", value: 20 }, { label: "expansion", value: 8 }, { label: "churn", value: -5 }, { label: "net", value: 23, kind: "total" }]} />
ts
/** @jsxImportSource solid-js */
import { WaterfallChart } from "@grassroot/charts-solid";
export default function WaterfallChartDemo() {
return <WaterfallChart data={[{ label: "start", value: 20 }, { label: "expansion", value: 8 }, { label: "churn", value: -5 }, { label: "net", value: 23, kind: "total" }]} />;
}

Installation

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

API Reference

WaterfallChartProps
PropTypeDefault
datarequiredreadonly WaterfallDatum[]