Microsoft® Excel File Charts Creation and Conversion via .NET

Create Excel document charts and convert to images using server-side APIs within .NET based applications.


Drawing charts is an art to display data graphically for easy analysis. .NET Excel Library supports drawing charts within Excel files. API supports different chart creation listed in ChartType Enumeration including pie, pyramid, line and bubble charts. Moreover, it also converts charts to images. API provides a Charts class for chart building blocks.

Create Charts within Excel File

Creating charts using Excel API is simple. Process is, Create Workbook class object and select the first worksheet or the relevant sheet by providing its index. Insert the required cells data using PutValue method . Add chart to the worksheet by using Charts collection’s Add method . Specify the ChartType from ChartType enumeration.

C# Code to Create Excel Charts

Convert Excel Charts to Images

Process of converting charts to images is, Use the Workbook class to load the Excel file, select the relevant workseet containing the charts and call the ToImage method for conversion.

C# Code to Convert Excel Chart to Image