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

Free Support Forum - aspose.com

How to Customize Charts in Excel using C#

I cannot determine on how to customize charts in Excel using C#, that is cut away the default series line colors on the right and get the plot line blue (or any other color).
I tried this:

// Setting the foreground colour
myChart.NSeries[VolumeReleased].SeriesLines.Color = Color.Red;

// set all the points to red
for (int i = 0; i < myChart.NSeries[VolumeReleased].Points.Count; i++)
myChart.NSeries[VolumeReleased].Points[i].Area.ForegroundColor = Color.Red;

but without any result.

Thank you very much


Could you try the line of code instead:
myChart.NSeries[VolumeReleased].Border.Color = Color.Red;

If you still find the issue, kindly do zip and attach the following files:

  1. Your input or output Excel file (containing the chart) by Aspose.Cells.
  2. Your expected file containing your your customized chart, you may do customize the chart in MS Excel manually.

Thank you very much.

Francesco Fornasiero

Eni ict


how_it_should_be.zip (229 KB)


Thanks for the file.

Could you also share output Excel file generated by Aspose.Cells containing the chart with your undesired results. Do you want to remove/hide secondary axis series (on the right side), legend or something else? Also, it would be good if you could share your complete sample code (runnable), so we could fix your code directly for your needs.

Hi Amjad,

in the attachment you can find the resulting charts generated by Aspose.Cells and the corresponding source code. The only thing I need is to remove secondary axis series on the right side.

Thank you very much


Chart.zip (152 KB)


I evaluated and found you are talking about right side Legend entry and want it should be hidden or not shown. Please try to add a line to your code segment:
myChart.ShowLegend = false;

Let us now if you still have any issue or other requirements.