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

Free Support Forum - aspose.com

Unwanted opacity color over chart

I have some issues related to the chart.while rendering this graph there is a grey opacity over the chart.How can I remove that?

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];

worksheet.Cells[0, 0].PutValue("Apple");
worksheet.Cells[0, 1].PutValue(50);
worksheet.Cells[0, 2].PutValue(100);

worksheet.Cells[1, 0].PutValue("Orange");
worksheet.Cells[1, 1].PutValue(50);
worksheet.Cells[1, 2].PutValue(20);
int chartIndex = worksheet.Charts.Add(ChartType.Column3DClustered, 5, 0, 15, 5);
Chart chart = worksheet.Charts[chartIndex];
chart.Title.Text = "Quantity for period 6/2016";    								
chart.Title.Font.Size = 6;
chart.NSeries.CategoryData = "A1:A2";    								
chart.CategoryAxis.TickLabels.Font.Size = 6;
chart.ChartArea.BackgroundMode = BackgroundMode.Transparent;    								
chart.NSeries.Add("B1:B2", true);    								
chart.NSeries.Add("C1:C2", true);    								
chart.NSeries[0].XValues = "A1:A2";    								
chart.NSeries[1].XValues = "A1:A2";    								
chart.NSeries[0].Name = "Quantity Balance";    								
chart.NSeries[1].Name = "Net Available";    								
chart.NSeries[0].DataLabels.ShowValue = true;    								
chart.NSeries[0].DataLabels.Font.Size = 6;    								
chart.NSeries[0].Area.ForegroundColor = Color.Red;    								
chart.NSeries[1].DataLabels.ShowValue = true;    								
chart.NSeries[1].DataLabels.Font.Size = 6;    								
chart.NSeries[1].Area.ForegroundColor = Color.Green;    								
chart.Legend.Position = LegendPositionType.Bottom;    								
chart.Legend.Font.Size = 6;    								
ImageOrPrintOptions options = new ImageOrPrintOptions()    								
VerticalResolution = 173,    									
HorizontalResolution = 200,    									
SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality    								
Image chartImage = chart.ToImage(options);    								
byte[] newImage = ConvertImageToByte(chartImage);    								
string image = Convert.ToBase64String(newImage);
dataUrl = "data:image/png;base64," + image;

Apple.PNG (28.3 KB)


Thanks for using Aspose APIs.

You need to update plot area of the chart. Please add this line and it will fix your issue.

chart.PlotArea.Area.Formatting = FormattingType.None; 

Please see the output image after doing this change for your reference.

output.png (7.3 KB)

Thanks it worked.But how to remove the border line?


Please add the following line and it will work for you. Please see the output image for your reference.

chart.PlotArea.Border.FormattingType = ChartLineFormattingType.None; 

output2.png (7.1 KB)