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-chartbash
npx grassroot@latest add chart/slopegraph-chartbash
yarn dlx grassroot add chart/slopegraph-chartbash
bunx grassroot add chart/slopegraph-chartAPI Reference
| Prop | Type | Default |
|---|---|---|
datarequired | readonly SlopegraphDatum[] | — |
startLabel | string | undefined | — |
endLabel | string | undefined | — |