Rendered image from Excel chart has more axis unit than the original chart


#1

Hi,

When rendering some Excel charts to images, I noticed there are extra units on some of the charts.

Code:

var fileName = “axis unit”; // axis unit 2 for 2nd test file
var workbook = new Workbook(fileName + “.xlsx”);
var options = new ImageOrPrintOptions
{
ImageType = ImageType.Emf,
OnlyArea = false,
TextRenderingHint = TextRenderingHint.ClearTypeGridFit,
OnePagePerSheet = true,
Transparent = true
};

        workbook.Worksheets["sheet1"].Charts[0].ToImage(fileName + ".emf", options);

Extra units were rendered in the charts. I’ve attached two test files and outputs, as well as screenshots for your reference. Could you please help me check this?

axis unit.zip (32.0 KB)
axis unit.png (52.4 KB)
axis unit 2.png (23.9 KB)

Thanks,


#2

@ServerSide527,

Thanks for the template files, sample code, screenshots and output image files.

I simply tried your scenario/ case using your sample code and template file(s) with our latest version/fix (Aspose.Cells for .NET v18.10.7) but got an error on the last line:
“Font ‘Source Sans Pro’ does not support style ‘Regular’”.

May be I have not installed the underlying font fine on my pc. Could you provide us the underlying font, so we could evaluate your issue precisely on our end.


#3

Hi,

Thanks for the update. I have tried 18.10.7 attached in the other post and still no luck on this issue. I have also attached the font file here:

SourceSansPro-Regular.zip (126.8 KB)

Thanks,


#4

@ServerSide527,

Thanks for sharing the font file.

I did install the font on my pc (OS: Windows 8) but still the exception (“Font ‘Source Sans Pro’ does not support style ‘Regular’”) occurred for your file(s). Even Ms Excel does not show the axis labels when opening the file into it.

Could you change the font and re-save the files to provide us here to reproduce the issue on our end, we will check it soon.


#5

Hi,

As requested I’ve attached the test files using the common font ‘Calibri’:

axis unit (2).zip (34.0 KB)

Thanks,


#6

Hi,

Just let you know that we have noticed such issues on different kind of charts, where the axis tickers or labels are incorrect in the images.

I’ve attached some additional test files for your reference:

axis issues.zip (84.0 KB)
axis issues 1.png (82.4 KB)

Thanks,


#7

@ServerSide527,

I am able to observe the issue as you mentioned by using your template files with your sample code. I found that the rendered images from MS Excel charts (in different workbooks) have more axis units than the original charts. I have logged a ticket with an id “CELLSNET-46450” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.


#8

@ServerSide527,

We evaluated your issue further. We are afraid the issues cannot be fixed for now. The count of axis units relates to the height of chart. If you drag the frame of chart to add the height of chart, the missing units will be shown. For axis unit.xlsx, first we can get the major unit 10 according to the source data (in other words, the units are 60,50,40…-30,-40). Second, we adjust the units count according to the chart’s height. If the labels are not overlapped, we think that is okay.


#9

Hi,

@Amjad_Sahi Thanks for the update.

I understand your thoughts on the relation between number of units and chart height. However, in my other examples in Rendered image from Excel chart has more axis unit than the original chart , this seems to cause more serious issues related to the units as the text are not visible/label in wrong position, which basically made the chart not readable. Could that be looked into?

image.png (81.2 KB)

Also regarding the initial issue, I understand the number of units will be shown if we add the height. But we are expecting Aspose to behave the same way as Office (with the same height it should present the same image output), so it would be good to make the behaviour consistent with Office as well.

Thanks,


#10

@ServerSide527,

Thanks for providing us further details and screenshot.

I have logged your concerns/details against your issue “CELLSNET-46450” into our database. We will look into it.

Once we have an update on it, we will let you know here.


#11

@ServerSide527,

Well, the issues found in axis unit.zip and axis unit 2.zip cannot be fixed now. But we will continue to look into axis issues.zip issues and once we have an update on it, we will you know here.

We are sorry for any inconvenience caused!


#12

@ServerSide527,

This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-46450”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.


#13

@ServerSide527,

Please try our latest version/fix: Aspose.Cells for .NET v18.11.6 (attached)

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells18.11.6 For .Net2_AuthenticodeSigned.Zip (4.7 MB)
Aspose.Cells18.11.6 For .Net4.0.Zip (4.7 MB)