Visualizing financial market data—such as opening, high, low, closing prices together with volume—is a common requirement for analysts and developers. Aspose.Cells for .NET makes it effortless to generate a StockVolumeOpenHighLowClose chart directly from code. In this guide you will learn how to:

  • Set up a workbook and populate it with OHLCV data.
  • Add a StockVolumeOpenHighLowClose chart.
  • Customize series, axes, legends, and styling.
  • Save the workbook to XLSX (or other supported formats).

Let’s dive in!

Table of Contents

C# Excel Library to Create StockVolumeOpenHighLowClose Chart

Aspose.Cells for .NET is a high‑performance Excel processing library that enables developers to create, edit, and render Excel files without Microsoft Office. It offers a rich charting API, including the ChartType.StockVolumeOpenHighLowClose chart, which combines a stock chart (open‑high‑low‑close) with a volume column chart.

Key benefits of using Aspose.Cells for financial charting:

  • No Office Interop – Works in cloud, services, and desktop environments.
  • Full .NET Standard support – Compatible with .NET 6, .NET 7, .NET Framework, and .NET Core.
  • Extensive customization – Control series type, axes, markers, colors, and more.
  • High‑speed processing – Efficient handling of large datasets.

Installation

Add Aspose.Cells to your project via NuGet:

PM> Install-Package Aspose.Cells

or via the .NET CLI:

dotnet add package Aspose.Cells

Create a StockVolumeOpenHighLowClose Chart in Excel using C#

Below you will find two complete examples:

  1. Basic chart – demonstrates the minimal steps required.
  2. Styled chart – shows how to customize colors, secondary axis, markers, and legend.

Both examples are ready to compile and run.

Step‑by‑Step Implementation

  1. Create a Workbook instance.
  2. Access the first worksheet (workbook.Worksheets[0]).
  3. Populate OHLCV data (Open, High, Low, Close, Volume).
  4. Add a chart using ChartType.StockVolumeOpenHighLowClose.
  5. Configure the series – set the data range, series names, and chart type for each series if needed.
  6. Optional customization – axes titles, legend position, colors, markers, secondary axis for volume, etc.
  7. Save the workbook to the desired format.

Full Example – Basic Chart

Explanation of the key lines

LinePurpose
ChartType.StockVolumeOpenHighLowCloseCreates a combined stock (OHLC) and volume column chart.
chart.NSeries.Add("=MarketData!$B$2:$E$6", true);Adds the OHLC series (Open‑High‑Low‑Close).
chart.NSeries.Add("=MarketData!$F$2:$F$6", true);Adds the Volume series.
chart.NSeries[0].CategoryData = "MarketData!$A$2:$A$6";Sets dates as the X‑axis categories.
chart.ShowLegend = true;Enables the legend so series names are visible.

Running the program produces StockVolumeOpenHighLowClose_Basic.xlsx with a functional financial chart.

Full Example – Styled Chart with Secondary Axis

The following example adds a professional look: custom colors, a secondary axis for volume, marker styles for the stock series, and a transparent plot area.

Highlights of this example

  • Candlestick style for the OHLC series (ChartType.Candlestick) with green upward bars and red downward bars.
  • Secondary Y‑axis for volume (PlotOnSecondAxis = true).
  • Semi‑transparent column fill for volume to keep the stock bars visible.
  • Date formatting on the category axis ("mmm dd").
  • Legend placed on the right for better space utilization.

Running the program creates StockVolumeOpenHighLowClose_Styled.xlsx, a polished financial chart ready for presentations or further analysis.

Get a Free License

Aspose.Cells offers a temporary free license that removes evaluation watermarks and enables full functionality for testing. Visit the temporary license page to obtain yours instantly.

// Example of applying a temporary license
var license = new License();
license.SetLicense("Aspose.Total.lic");   // Path to your downloaded license file

Free Resources

Conclusion

Creating a StockVolumeOpenHighLowClose chart with Aspose.Cells for .NET is straightforward:

  1. Populate your worksheet with OHLCV data.
  2. Add the combined chart type.
  3. Customize series, axes, and styling to match your visual standards.
  4. Save the workbook in any supported format.

With the provided code snippets you can integrate financial charting into reporting tools, dashboards, or automated Excel generation pipelines with just a few lines of C#.

For additional assistance, visit our free support forum – our experts are ready to help.

See Also