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

DocsChartsComparison & rank

SlopegraphChart

React example follows below.
ts
import { SlopegraphChart } from "@grassroot/charts-react";
<SlopegraphChart data={[{ label: "Activation", start: 12, end: 24 }, { label: "Retention", start: 20, end: 18 }]} />
ts
<script setup lang="ts">
import { SlopegraphChart } from "@grassroot/charts-vue";
</script>
<template>
<SlopegraphChart :data='[{ label: "Activation", start: 12, end: 24 }, { label: "Retention", start: 20, end: 18 }]' />
</template>
ts
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootSlopegraphChart } from "@grassroot/charts-angular";
@Component({
selector: "app-slopegraph-chart-chart-demo",
standalone: true,
imports: [GrassrootSlopegraphChart],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<grassroot-slopegraph-chart [data]='[{ label: "Activation", start: 12, end: 24 }, { label: "Retention", start: 20, end: 18 }]' />`,
})
export class SlopegraphChartDemoComponent {
}
export default SlopegraphChartDemoComponent;
ts
<script lang="ts">
import { SlopegraphChart } from "@grassroot/charts-svelte";
</script>
<SlopegraphChart data={[{ label: "Activation", start: 12, end: 24 }, { label: "Retention", start: 20, end: 18 }]} />
ts
/** @jsxImportSource solid-js */
import { SlopegraphChart } from "@grassroot/charts-solid";
export default function SlopegraphChartDemo() {
return <SlopegraphChart data={[{ label: "Activation", start: 12, end: 24 }, { label: "Retention", start: 20, end: 18 }]} />;
}

Installation

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

API Reference

SlopegraphChartProps
PropTypeDefault
datarequiredreadonly SlopegraphDatum[]
startLabelstring | undefined
endLabelstring | undefined