DocsChartsFinancial
OHLCChart
React example follows below.
ts
import { OHLCChart } from "@grassroot/charts-react"; const ohlc = [ { id: "jan-01", date: "2026-01-01", open: 12, high: 18, low: 10, close: 16, volume: 120 }, { id: "jan-02", date: "2026-01-02", open: 16, high: 20, low: 13, close: 14, volume: 90 }, { id: "jan-03", date: "2026-01-03", open: 14, high: 22, low: 12, close: 21, volume: 160 },]; <OHLCChart data={ohlc} />ts
<script setup lang="ts">import { OHLCChart } from "@grassroot/charts-vue"; const ohlc = [ { id: "jan-01", date: "2026-01-01", open: 12, high: 18, low: 10, close: 16, volume: 120 }, { id: "jan-02", date: "2026-01-02", open: 16, high: 20, low: 13, close: 14, volume: 90 }, { id: "jan-03", date: "2026-01-03", open: 14, high: 22, low: 12, close: 21, volume: 160 },];</script> <template> <OHLCChart :data='ohlc' /></template>ts
import { ChangeDetectionStrategy, Component } from "@angular/core";import { GrassrootOHLCChart } from "@grassroot/charts-angular"; @Component({ selector: "app-ohlcchart-chart-demo", standalone: true, imports: [GrassrootOHLCChart], changeDetection: ChangeDetectionStrategy.OnPush, template: `<grassroot-ohlcchart [data]='ohlc' />`,})export class OHLCChartDemoComponent { readonly ohlc = [ { id: "jan-01", date: "2026-01-01", open: 12, high: 18, low: 10, close: 16, volume: 120 }, { id: "jan-02", date: "2026-01-02", open: 16, high: 20, low: 13, close: 14, volume: 90 }, { id: "jan-03", date: "2026-01-03", open: 14, high: 22, low: 12, close: 21, volume: 160 }, ];} export default OHLCChartDemoComponent;ts
<script lang="ts"> import { OHLCChart } from "@grassroot/charts-svelte"; const ohlc = [ { id: "jan-01", date: "2026-01-01", open: 12, high: 18, low: 10, close: 16, volume: 120 }, { id: "jan-02", date: "2026-01-02", open: 16, high: 20, low: 13, close: 14, volume: 90 }, { id: "jan-03", date: "2026-01-03", open: 14, high: 22, low: 12, close: 21, volume: 160 }, ];</script> <OHLCChart data={ohlc} />ts
/** @jsxImportSource solid-js */import { OHLCChart } from "@grassroot/charts-solid"; const ohlc = [ { id: "jan-01", date: "2026-01-01", open: 12, high: 18, low: 10, close: 16, volume: 120 }, { id: "jan-02", date: "2026-01-02", open: 16, high: 20, low: 13, close: 14, volume: 90 }, { id: "jan-03", date: "2026-01-03", open: 14, high: 22, low: 12, close: 21, volume: 160 },]; export default function OHLCChartDemo() { return <OHLCChart data={ohlc} />;}Installation
bash
pnpm dlx grassroot add chart/ohlc-chartbash
npx grassroot@latest add chart/ohlc-chartbash
yarn dlx grassroot add chart/ohlc-chartbash
bunx grassroot add chart/ohlc-chartAPI Reference
| Prop | Type | Default |
|---|---|---|
datarequired | readonly OhlcDatum[] | — |