OHLC Chart in C#
Draw OHLC bar charts in C# with AddOhlc and OhlcPoint — high-low bars with open and close ticks, rendered as self-contained SVG from .NET.
OHLC Bars
AddOhlc() — high-low bar with open/close ticks.
When to use a ohlc chart
Reach for it when
- The same OHLC data as a candlestick, when you want the thinner, more traditional bar form.
- Dense series — OHLC bars stay legible at narrower spacing than candle bodies do.
- Print and greyscale output, where the open/close ticks survive without colour.
Use something else when
- Small render sizes, where the open and close ticks fall below a pixel or two and disappear.
- Readers who find the tick convention harder than candle bodies — candlesticks are more widely recognised.
- Non-financial data, for the same reason as candlesticks.
OHLC Chart in C#
Lifted verbatim from the chart types reference, so it compiles against the shipped API. See the API reference for every overload and the exact data types each series method accepts.
using TerraFluent.Chart.Reporting.Models;
string svg = ChartBuilder.Create()
.Title("ACME — OHLC Bars")
.Size(720, 420)
.XAxis("Day", "Mon","Tue","Wed","Thu","Fri")
.YAxis("Price ($)")
.AsAnimated()
.Series(s => s
.AddOhlc("ACME", new[]
{
new OhlcPoint(120, 128, 118, 126),
new OhlcPoint(126, 130, 122, 123),
new OhlcPoint(123, 133, 121, 132),
new OhlcPoint(132, 135, 128, 129),
new OhlcPoint(129, 140, 127, 138),
}))
.RenderToSvg();Install
dotnet add package TerraFluent.Chart.Reporting
- MIT licensed — free for commercial use, no chart limits, no watermarks.
- Zero dependencies — nothing but the .NET base class library.
- netstandard2.0 through net10.0 — .NET Framework 4.6.1+, .NET Core 2.0+, and every modern release.
- Output is one SVG string — embed it in HTML, a PDF, or a Word document.