Apply Soft Edges effect to Excel Chart in C#

This article elaborates the steps to apply soft edges effect to an excel chart using Spire.XLS.

The example Excel file we used for demonstration:

Apply Soft Edges effect to Excel Chart in C#

Detail steps:

Step 1: Instantiate a Workbook object and load the excel file.

Workbook workbook = new Workbook();
workbook.LoadFromFile("Input.xlsx");

Step 2: Get the first worksheet.

Worksheet sheet = workbook.Worksheets[0];

Step 3: Get the chart.

IChart chart = sheet.Charts[0];

Step 4: Specify the size of the soft edge. Value can be set from 0 to 100.

chart.ChartArea.Shadow.SoftEdge = 10;

Step 5: Save the file.

workbook.SaveToFile("Output.xlsx", ExcelVersion.Version2013);

Output:

Apply Soft Edges effect to Excel Chart in C#

Full code:

using Spire.Xls;
using Spire.Xls.Core;

namespace Soft_Edges_in_Excel_Chart
{
    class Program
    {
        static void Main(string[] args)
        {
            //Instantiate a Workbook object
            Workbook workbook = new Workbook();
            //Load the Excel file
            workbook.LoadFromFile("Input.xlsx");

            //Get the first worksheet
            Worksheet sheet = workbook.Worksheets[0];

            //Get the chart
            IChart chart = sheet.Charts[0];

            //Specify the size of the soft edge. Value can be set from 0 to 100
            chart.ChartArea.Shadow.SoftEdge = 10;

            //Save the file
            workbook.SaveToFile("Output.xlsx", ExcelVersion.Version2013);
        }
    }
}