This page is part of the ScottPlot 5.0 Cookbook
⚠️ ScottPlot 5.0.8-beta is a preview package
This page describes a beta release of ScottPlot. It is available on NuGet as a preview package, but its API is not stable and it is not recommended for production use. See the ScottPlot Versions page for more information.
OHLC Chart
OHLC charts use symbols to display price data (open, high, low, and close) for specific time ranges.
ScottPlot.Plot myPlot = new();
ScottPlot.RandomDataGenerator gen = new(0);
var prices = gen.RandomOHLCs(30);
myPlot.Add.OHLC(prices);
myPlot.AxisStyler.DateTimeTicks(Edge.Bottom);
myPlot.SavePng("ohlc-chart.png");
Candlestick Chart
Candlestick charts use symbols to display price data. The rectangle indicates open and close prices, and the center line indicates minimum and maximum price for the given time period. Color indicates whether the price increased or decreased between open and close.
ScottPlot.Plot myPlot = new();
ScottPlot.RandomDataGenerator gen = new(0);
var prices = gen.RandomOHLCs(30);
myPlot.Add.Candlestick(prices);
myPlot.AxisStyler.DateTimeTicks(Edge.Bottom);
myPlot.SavePng("candlestick-chart.png");