Converting chart to image is not accurate

I have a problem when converting excel charts to images. When the chart type is Radar and the value type percent, the values on the value axis are multiplied with 100 (making 30% 3000%).

This happens ONLY when I convert the chart to image. When I execute the same code to produce an XLSX, everything is OK on the charts. It seems that sth happens during the conversion to image.
Here is the code that I use for XLSX, in order to set up the axis properly (this works fine for XLSX charts but not for the generated images of the same charts):

		private void SetValueAxisStyles(Chart pChart, IExportCon pCont)
{
var lAxis = pChart.ValueAxis;
if (lAxis != null)
{
if (pCont.ValueType == ReportValueType.Percent)
{
lAxis.DisplayUnit = DisplayUnitType.Hundreds;
lAxis.IsDisplayUnitLabelShown = false;
lAxis.CategoryType = CategoryType.AutomaticScale;
lAxis.TickLabels.NumberFormat = “0%”;
				<span style="color:green;">// Charts with percentage values must have a scale up to 100% (no less).</span>
				lAxis.IsAutomaticMaxValue = <span style="color:blue;">false</span>;
				lAxis.IsAutomaticMinValue = <span style="color:blue;">false</span>;
				lAxis.MaxValue = 100.0f;
				lAxis.MinValue = 0.0f;
				lAxis.DisplayUnit = <span style="color:#2b91af;">DisplayUnitType</span>.Hundreds;
			}
		}
	}</pre><pre style="font-family: Consolas; background-position: initial initial; background-repeat: initial initial;">Can you tell me why this code doesn't work on the radar chart images and what code I should use instead?

I had a similar problem in the past and I’ve solved it by setting the value of a property (the image converter used different default values?).
But here I don’t think I have left a related property unset…


Thanks,
Kostas

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please download and try the latest version: Aspose.Cells
for .NET v7.5.0.4
and see if it works fine.

If your problem still occurs, please provide us your sample runnable project replicating this issue with the latest version.

Please also try creating workbook like this and see if it resolves your issue.

Workbook workbook = new Workbook(FileFormatType.Xlsx);

I already create the workbook like that and I use Aspose.Cells for .NET v7.5.0.0.
I’ll see if I find time to try the newest library.


Thanks,
Kostas

Hi,


Yes, as my fellow colleague told you kindly try our latest fix i.e…, v7.5.0.4. If you still find the issue, I am afraid, we need your sample (runnable) console application (you may zip it prior attaching here), we will check your issue soon.

Thank you.

Hello.


Here are the data and code that reproduces the bug.
I use the latest Aspose Cells (v7.5.0.4).

Thanks,
Kostas

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We were able to replicate this issue while converting your source file into image. The chart image is not correct. Please see the attached chart image for your reference.

We have logged this issue in our database. We will look into it and resolve 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-41816.

Hi,

Please download and try our latest version/fix: Aspose.Cells for .NET v7.5.1.2.

We have fixed y scales of Radar
chart’s issues when the axis sets the display unit
.


Let us know your feedback.

Thank you.

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


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