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

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-chart
bash
npx grassroot@latest add chart/histogram-chart
bash
yarn dlx grassroot add chart/histogram-chart
bash
bunx grassroot add chart/histogram-chart

API Reference

HistogramChartProps
PropTypeDefault
valuesreadonly number[] | undefined
binsreadonly HistogramBin[] | undefined
binCountnumber | undefined