Problem when convert Chart to pdf

Horizontal axis of chart inside pdf file is scaled wrong and reversed.

Here is example:

var workbook = new Workbook();

Worksheet worksheet = workbook.Worksheets[0];

worksheet.Cells["K1"].PutValue(10);
worksheet.Cells["K2"].PutValue(50);
worksheet.Cells["K3"].PutValue(100);
worksheet.Cells["K4"].PutValue(200);
worksheet.Cells["K5"].PutValue(400);
worksheet.Cells["K6"].PutValue(1000);
worksheet.Cells["K7"].PutValue(2000);
worksheet.Cells["K8"].PutValue(3000);
worksheet.Cells["K9"].PutValue(5000);
worksheet.Cells["K10"].PutValue(6000);
worksheet.Cells["K11"].PutValue(7000);
worksheet.Cells["K12"].PutValue(8000);
worksheet.Cells["K13"].PutValue(9000);
worksheet.Cells["K14"].PutValue(10000);

worksheet.Cells["L1"].PutValue(10.1);
worksheet.Cells["L2"].PutValue(24.2);
worksheet.Cells["L3"].PutValue(31.3);
worksheet.Cells["L4"].PutValue(46.2);
worksheet.Cells["L5"].PutValue(59.2);
worksheet.Cells["L6"].PutValue(82.3);
worksheet.Cells["L7"].PutValue(87.2);
worksheet.Cells["L8"].PutValue(91.1);
worksheet.Cells["L9"].PutValue(94.2);
worksheet.Cells["L10"].PutValue(94.9);
worksheet.Cells["L11"].PutValue(95.4);
worksheet.Cells["L12"].PutValue(95.8);
worksheet.Cells["L13"].PutValue(96.1);
worksheet.Cells["L14"].PutValue(96.4);

int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.ScatterConnectedByCurvesWithDataMarker, 0, 0, 20, 7);

Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex];

chart.PlotVisibleCells = false;

int index = chart.NSeries.Add("L1:L13", true);
chart.NSeries[index].XValues = "K1:K13";


var pdfSaveOption = new PdfSaveOptions()
{
AllColumnsInOnePagePerSheet = true
};


workbook.Save("test.pdf", pdfSaveOption);
Process.Start("test.pdf");

Hi,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after executing your code with the latest version: Aspose.Cells
for .NET v8.6.2.2
and found that chart horizontal axis is wrong. But when save it in xlsx format the chart looks good.

We have therefore logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-44086 - Horizontal axis of chart inside pdf file is scaled wrong and reversed

Hi,

Please try our latest version/fix: Aspose.Cells for .NET v8.6.2.4


We have fixed your issue now.

Let us know your feedback.

Thank you.

The issues you have found earlier (filed as CELLSNET-44086) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(1)