Incorrect axis spacing when converting from xlsx workbook to emf

Hello, I am trying to convert an excel chart into an EMF image. However, the axis spacing on the chart in the EMF is not the same as in the excel workbook. I have provided two examples, one where the primary axis is effected and another where the secondary axis is effected.

I used the following code snippet for the conversion:

        Workbook workbook = new Workbook("secondary_axis.xlsx");
        Aspose.Cells.Charts.Chart chart = workbook.Worksheets[0].Charts[0];
        chart.ToImage("output_secondary.emf", System.Drawing.Imaging.ImageFormat.Emf);

For example, in secondary_axis.xlsx, the chart’s secondary axis uses a 20% step between each label. However, in the corresponding EMF output in “output_secondary.emf” it has a 10% step.

This only seems to be an issue when setting the Major units in excel to Auto. When setting it manually, the axis are spaced as expected.

The following zip file contains the two test cases, and their corresponding EMF outputs.

incorrect_axis.zip (33.1 KB)

Thanks.

@ServerSide527,
This issue is reproduced here and logged in our database for further investigation. You will be notified here once any update is ready for sharing.

This issue is logged as:
CELLSNET-48049 - Different axis spacing when converting from xlsx workbook to emf

@ServerSide527,
This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@ServerSide527,
Please try our latest fix
Aspose.Cells21.5.4 For .Net2_AuthenticodeSigned.Zip (5.5 MB)
Aspose.Cells21.5.4 For .Net4.0.Zip (5.5 MB)
Aspose.Cells21.5.4 For .NetStandard20.Zip (5.5 MB)

The issues you have found earlier (filed as CELLSNET-48049) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao

Hi @ahsaniqbalsidiqui @Eric.wang

Thanks for the update.

I have tested the fix with 21.7.0 but we found the issue was not fully fixed. In my initial attachment there are two examples and only the ‘secondary_axis.xlsx’ was fixed but the issue still exists on ‘primary_axis.xlsx’, where the axis spacing was still incorrect.

Could you help to take a further look into this?

Thanks,

@ServerSide527,
We have observed this issue and reopened the ticket for further investigation.

@ServerSide527,

Please note, when major/minor units are set to automatic, I am afraid, we cannot do well same as MS Excel.