Chart Legend can't be aligned center

Hi,

I have created a chart use aspose.cell, and then show it on the webpage. But, the legend algin left (not center of chart). I have tried the setting: Legend.X= 500, however, it does not change anything.(please see the shotcut of my chart in attachment)

could you share me some idear so that I can move the legend to center of chart?

Thanks,

Best regards

Hi,


Please try our latest version/fix i.e. Aspose.Cells for .NET v7.4.3:
http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry460770.aspx

Also, kindly try:
chart.Calculate();
after you change the position of the Legend.

If you still find the issue, kindly do create a sample console application (runnable), zip it and post it here to show the issue on our end. Also provide the template Excel and other files here, we will check your issue soon.

Thank you.

Hi,

I have followed with your guide(update to the newest v7.4.3 and try chart.Calculate()), but the issue still remained.

I have attached a simple project which can show my problem. Can you help check this issue?

BTW, I don't include the 'Aspose.Cells.dll' in demo, because the size is limited. so, please add it when you run the project(add to 'AsposeDell' folder ).

Thanks a lot!

Hi,

Thanks for the sample project and template file.

After an initial test, I can observe the issue by simply converting the chart (in the template file) to image file. The chart's legend is not aligned center/properly at the bottom in the output image as per the original chart.

Sample code:
Dim workbook As Workbook = New Workbook("e:\test2\demo.xlsx")
Dim sheet As Worksheet = workbook.Worksheets(1)
Dim chart As Chart = sheet.Charts(0)
chart.ToImage("e:\test2\mydemochart.png", ImageFormat.Png)


I have logged a ticket with an id "CELLSNET-41632" for your issue. We will look into your issue to figure it out soon.

Thank you.

My I follow up with the topic?

BTW, how can I check the a ticket (CELLSNET-41632) status? There is no link on the page.

Hi,


I am afraid, your issue (“CELLSNET-41632”) is not resolved yet. I have asked the relevant developer to update on it or share an eta (if possible). Once we have any update on it, we will let you know here.

Well, I am afraid, you cannot check or access to our issue tracking system, it is internal and used to manage issues. You always, need to ask us to know the status of the issue.

Thank you.

Hi,

To update you further, we will provide a new fix in the next week. Now you can modify some of your code segments of the project for setting the position of the legend.

We have updated the project you attached to this thread. Please check the method SetLegned in TC1.vb. If you run the program, right click on “Right Align of Plot Area” link in Default.aspx, the “way2” will run, The position of legend will be changed. You may set other value to layout the legend to anywhere you want.

Thank you.

Hi,

Basing on your code, I still have the issue if I set the legend font size (TC1.vb Line 101) and change the serise name in different width, the legend ‘looks like’ in wrong postion, especially in case of horizontal center position.

Please see the attachment.

Hi,


Thanks for sharing the project.

It looks like a new issue. We have logged a ticket with an id “CELLSNET-41695” for this issue. We will look into it soon.

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


Thank you.
Hi,

Please download and try this fix: Aspose.Cells for .NET v7.4.3.3 and let us know your feedback.

Your issue should be fixed in it.

Thank you.

Hi,

I have downloaded the latest version, and it works fine. However, there is another issue, please see the attachment.

Attached image shows that the legend position is set horizontal center, but if we remove the legend border, the whole legend section seems to be ‘left aligned’, any idea about this issue?

Hi,


Good to know that the latest fix v7.4.3.3 is working for you.

Regarding your issue i.e. “legend section seems to be left aligned…”, please give us a sample console application with v7.4.3.3, zip it and post it here, we will check your issue soon. Also attach your template files as well.

Thank you.

Hi,

I have attached the sample application - in fact, it is the same as the application attached before, I just removed the legend border (TC1.vb Line 94-99).

Hi,


Thanks for the sample project with details.

After an initial test, I can see the issue with the image as you have pointed out. I have reopened your existing issue “CELLSNET-41632”. Our concerned developer will look into it soon.

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

Thank you.

Hi,

Thanks for your posting and using Aspose.Cells.

Well, we think it is ok. The legend is in center of the chart. It seems to be left as the text of third column legend item is too short. If you export the chart to excel file, and open it with Ms.Excel, you will find the legend in excel is not in center too. If you try to drag the legend to right in excel, the legend can’t be moved out of the chart right frame.

Also, you set the fill format of chart area to none. It will cause the text being blurry. We can’t not solve the problem because .Net framework is not good in drawing text in no background color image.

It is best set the format of chart area to automatic

Please also see the attachment.

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


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

@Amjad_Sahi exactly the same problem in Aspose cells for java, is there anything I can do?

@sZiu,

Could you please provide sample Java code (runnable) with sample files (please zip template Excel file and other files prior attaching) and post us to show the issue on our end. We will check your issue soon.