DocsChartsCartesian & statistical
HistogramChart
React example follows below.
ts
import { HistogramChart } from "@grassroot/charts-react"; <HistogramChart values={[3, 4, 4, 6, 8, 9, 12, 14, 14, 18]} />ts
<script setup lang="ts">import { HistogramChart } from "@grassroot/charts-vue";</script> <template> <HistogramChart :values='[3, 4, 4, 6, 8, 9, 12, 14, 14, 18]' /></template>ts
import { ChangeDetectionStrategy, Component } from "@angular/core";import { GrassrootHistogramChart } from "@grassroot/charts-angular"; @Component({ selector: "app-histogram-chart-chart-demo", standalone: true, imports: [GrassrootHistogramChart], changeDetection: ChangeDetectionStrategy.OnPush, template: `<grassroot-histogram-chart [values]='[3, 4, 4, 6, 8, 9, 12, 14, 14, 18]' />`,})export class HistogramChartDemoComponent { } export default HistogramChartDemoComponent;ts
<script lang="ts"> import { HistogramChart } from "@grassroot/charts-svelte";</script> <HistogramChart values={[3, 4, 4, 6, 8, 9, 12, 14, 14, 18]} />ts
/** @jsxImportSource solid-js */import { HistogramChart } from "@grassroot/charts-solid"; export default function HistogramChartDemo() { return <HistogramChart values={[3, 4, 4, 6, 8, 9, 12, 14, 14, 18]} />;}Installation
bash
pnpm dlx grassroot add chart/histogram-chartbash
npx grassroot@latest add chart/histogram-chartbash
yarn dlx grassroot add chart/histogram-chartbash
bunx grassroot add chart/histogram-chartAPI Reference
| Prop | Type | Default |
|---|---|---|
values | readonly number[] | undefined | — |
bins | readonly HistogramBin[] | undefined | — |
binCount | number | undefined | — |