Visualizing financial data such as stock prices, high‑low‑close values, and trading volumes is a common requirement for analysts and developers. With Aspose.Cells for .NET, you can generate a StockHighLowClose chart directly from your C# application without needing Microsoft Excel installed.

In this article you will learn:

  • How Aspose.Cells simplifies chart creation.
  • Step‑by‑step code to create a StockHighLowClose chart.
  • Customization options for axes, legends, and markers.
  • How to update an existing chart.

C# Excel Library to Create StockHighLowClose Chart

Aspose.Cells for .NET is a powerful, fully managed library that enables developers to create, modify, and render Excel files programmatically. It supports all major Excel formats and provides an extensive API for working with worksheets, cells, charts, pivot tables, and more.

Key benefits for chart generation:

  • No Excel interop required – works on any platform where .NET runs.
  • Full chart type support – including Stock, Candlestick, OHLC, and StockHighLowClose.
  • Rich customization – colors, markers, axis titles, secondary axes, etc.
  • High performance – suitable for large data sets.

Getting Started

  1. Download the latest Aspose.Cells for .NET from the official releases page.

  2. Install the NuGet package:

    PM> Install-Package Aspose.Cells
    
  3. Add a reference to Aspose.Cells in your C# project.

Create a StockHighLowClose Chart in Excel using C#

Below is a complete, ready‑to‑run C# console program that creates a worksheet, populates it with sample OHLC data, adds a StockHighLowClose chart, and saves the workbook as StockChart_Output.xlsx.

Explanation of the Code

StepWhat the code does
1️⃣Instantiates a new Workbook and accesses the first worksheet.
2️⃣Writes header titles and fills rows with date, open, high, low, and close values.
3️⃣Adds a ChartType.StockHighLowClose chart positioned below the data table.
4️⃣Links the chart to the worksheet range and defines the category (date) axis.
5️⃣Sets axis titles and enables grid lines for easier reading of price levels.
6️⃣Shows a legend on the right side and customizes the data‑point markers.
7️⃣Saves the workbook as StockChart_Output.xlsx.

Running the program produces an Excel file that contains a fully functional StockHighLowClose chart, ready to be opened in Microsoft Excel, LibreOffice, or any other viewer that supports the XLSX format.

Get a Free License

Aspose.Cells offers a temporary free license that removes evaluation watermarks and unlocks full functionality. Obtain one from the Aspose temporary license page. Apply the license at the start of your application:

License license = new License();
license.SetLicense("Aspose.Total.lic");   // Path to your temporary license file

Free Resources

Conclusion

Creating a StockHighLowClose chart with Aspose.Cells for .NET is straightforward and does not require Microsoft Excel on the server. By following the complete example above, you can generate professional‑looking financial charts, customize them to match your brand, and integrate them into reporting pipelines or web applications.

If you have any questions, need assistance, or want to share your experience, feel free to join the community at the Aspose.Cells Support Forum.

See Also