We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Chart Formating

Attached is a chart created in Excel 2016.
I am trying to copy the gradient fill in the Chart Area - can you please supply the required code for this?

Chart.zip (14.1 KB)


Thanks for the template file.

See the following sample code on how to apply different types of gradient fill formats to chart area. I used your template file to apply gradient formattings on the existing chart for your reference (you may change the parameter values or other attributes for your needs):
Sample code:

 var workbook = new Workbook("e:\\test2\\Chart.xlsx");
            var worksheet = workbook.Worksheets[0];
            var chart = worksheet.Charts[0];
            //Set one color gradient.
            chart.ChartArea.Area.FillFormat.SetOneColorGradient(System.Drawing.Color.LightBlue, 0.4, Aspose.Cells.Drawing.GradientStyleType.FromCenter, 2);
            //Set two color gradient.
            chart.ChartArea.Area.FillFormat.SetTwoColorGradient(Color.Gray, Color.LightGray, GradientStyleType.FromCenter, 2);
            //Set present color gradient.

Hope, this helps a bit.

Thank you.