Charts

Copy-paste chart examples for every Bklit UI component.

Candlestick Chart – Tooltip line matches candle

Default palette (--chart-1 and --chart-5). The crosshair color follows the focused candle; no dot.

<CandlestickChart data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <Candlestick    fadedOpacity={0.25}    negativeFill="var(--chart-5)"    positiveFill="var(--chart-1)"  />  <ChartTooltip    content={OHLCTooltipContent}    indicatorColor={(p) => (p.close >= p.open) ? "var(--chart-1)" : "var(--chart-5)"}    showDots={false}  />  <XAxis /></CandlestickChart>interface OHLCDataPoint {  date: Date;  open: number;  high: number;  low: number;  close: number;}const ohlcData: OHLCDataPoint[] = [ ... ];

Trending up by 5.2% this month

Candlestick – Tooltip line matches candle

Lime–emerald and yellow–red gradients. Crosshair color matches the focused candle (green/red); no dot.

<LinearGradient from="var(--color-lime-400)" id="candle-up" to="var(--color-emerald-500)" /><LinearGradient from="var(--color-yellow-400)" id="candle-down" to="var(--color-red-500)" /><CandlestickChart data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <Candlestick    fadedOpacity={0.25}    negativeFill="url(#candle-down)"    positiveFill="url(#candle-up)"  />  <ChartTooltip    content={OHLCTooltipContent}    indicatorColor={(p) => (p.close >= p.open) ? "var(--chart-positive)" : "var(--chart-negative)"}    showDots={false}  />  <XAxis /></CandlestickChart>

Trending up by 5.2% this month

Candlestick – Chart 1 & 3

Using --chart-1 and --chart-3 for a stronger contrast

<CandlestickChart data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <Candlestick    fadedOpacity={0.25}    negativeFill="var(--chart-3)"    positiveFill="var(--chart-1)"  />  <ChartTooltip content={CandlestickTooltipContent} />  <XAxis /></CandlestickChart>

Trending up by 5.2% this month

Candlestick – Lime to emerald, yellow to red

Custom gradients: lime–emerald for up, yellow–red for down

<LinearGradient from="var(--color-lime-400)" id="up" to="var(--color-emerald-500)" /><LinearGradient from="var(--color-yellow-400)" id="down" to="var(--color-red-500)" /><CandlestickChart data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <Candlestick fadedOpacity={0.25} negativeFill="url(#down)" positiveFill="url(#up)" />  <ChartTooltip content={CandlestickTooltipContent} />  <XAxis /></CandlestickChart>

Trending up by 5.2% this month

Candlestick – Solid colors

Solid emerald/red fills instead of gradients

<CandlestickChart candleWidth={8} data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <Candlestick    negativeFill="var(--color-red-500)"    positiveFill="var(--color-emerald-500)"  />  <ChartTooltip content={CandlestickTooltipContent} />  <XAxis /></CandlestickChart>

Trending up by 5.2% this month

Candlestick – Pattern

Diagonal pattern overlay on candle bodies

<CandlestickChart candleGap={0.15} data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <PatternLines id="candle-up" orientation={["diagonal"]} stroke="rgba(0,0,0,0.35)" ... PatternLines  >/> id="candle-down" orientation={["diagonal"]} stroke="rgba(0,0,0,0.35)" ... Candlestick  >/> bodyPatternNegative="url(#candle-down)" bodyPatternPositive="url(#candle-up)" />  <ChartTooltip content={CandlestickTooltipContent} />  <XAxis /></CandlestickChart>

Trending up by 5.2% this month

Candlestick – Tooltip only

Tooltip box without crosshair or dots

<CandlestickChart data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <Candlestick fadedOpacity={0.25} />  <ChartTooltip content={CandlestickTooltipContent} showCrosshair={false} showDots={false} />  <XAxis /></CandlestickChart>

Trending up by 5.2% this month

Candlestick - Pattern Background

Diagonal pattern fill instead of grid lines

<CandlestickChart data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <Background />  <Candlestick fadedOpacity={0.25} />  <ChartTooltip content={CandlestickTooltipContent} />  <XAxis /></CandlestickChart>

Use Background instead of Grid — see /docs/utility/background

Candlestick - Dot Grid Background

Dot grid texture with edge fade

<CandlestickChart data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <Background pattern="dots" opacity={0.85} />  <Candlestick fadedOpacity={0.25} />  <ChartTooltip content={CandlestickTooltipContent} />  <XAxis /></CandlestickChart>

Trending up by 5.2% this month

Candlestick - Reference Band

Horizontal Y band behind the series with dashed edges and bracket markers

<CandlestickChart data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <ReferenceArea y1={98} y2={108} strokeStyle="dashed" showMarkers />  <Candlestick fadedOpacity={0.25} />  <ChartTooltip content={CandlestickTooltipContent} />  <XAxis /></CandlestickChart>

See /docs/utility/reference-area — tune bounds, fill, and markers in Studio

Candlestick - Pattern Reference Band

Pattern fill inside the band with colored Y-axis tick labels

<CandlestickChart data={ohlcData} margin={{ top: 8, right: 8, bottom: 40, left: 8 }} style={{ height: 320 }}>  <ReferenceArea    y1={98}    y2={108}    pattern="diagonal"    patternColor="var(--chart-foreground-muted)"    axisLabelColor="var(--chart-1)"    fillOpacity={0.85}  />  <Candlestick fadedOpacity={0.25} />  <ChartTooltip content={CandlestickTooltipContent} />  <XAxis /></CandlestickChart>

Trending up by 5.2% this month