Hi,
Hi.
One more question. I have the following line of code that formats the text on my pie segments:
series.Points[i].DataLabels.Text = e.DataPointLabel + "\r\n" + e.DataPointValue.ToString(DefinitionProperties["###%"]);
In Excel, the text appears as expected. However, when I "toImage" the graph, instead of having a label that says : "Global Equity 12%", I have a label that just says "0.12".
Is this me doing something wrong, or is customization of the DataLabels.Text not supported in the "toImage" functionality?
I noticed this was logged as a bug last year in the Java version. I suspect the bug still exists for .Net? <A href="</A></P> <P>Oh, and one more thing, the labels in the image appear much larger and bolder than it does in excel. Is it possible that we could have that fixed too?</P> <P><FONT size=2><FONT size=3>Thanks</FONT></P></FONT>
Hi,
Please post your generated Excel file (you may save an Excel file containing the updated chart) and output image file, we will check your issue soon.
Thank you.
Hi.
Thanks for the quick response.
Please find both the Excel file and the Word doc attached.
Regards
I have tested your file converting the chart into image file using Aspose.Cells for .NET v5.3.2.6, it works OK, I have attached the output file using the sample code:
var options = new ImageOrPrintOptions();
options.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf;
Workbook wb = new Workbook(“e:\test2\ReportTest1.xlsx”);
Chart chart = wb.Worksheets[0].Charts[0];
chart.ToImage(@“e:\test2\outputImage.emf”, options);
Please try v5.3.2.6.
Thank you.
I just found this post from 2007 as well: https://forum.aspose.com/t/102324
I couldn't figure out whether this post applies to .Net, but in it, the "DataLabels.Text not reflecting on the image" issue was reported as well. In the second last post, Roger Mo reported that the issue will be fixed within that week, so I'm assuming it won't be a big deal to fix.
Thanks so much.
That is reasuring. I'll check through my code to see where I've done it wrong.
Hi,
If you are still not able to generate expected images, please post the whole code you used.
The code should reflect how did you create chart objects using Aspose.Cells API and inserted chart images to word document using Aspose.Words API.
Note:
Aspose.Cells support converting most of the charts to images except bubble 3d and surface chart and it also support most of the features except Perspective ( 3D Rotation --> 3D Format --> Rotation), 3-D Format, Shadow and placing some complex DataLabels of Points of 3D Pie chart to suitable location when the Label Position of the DataLabels are Best Fit.
For further help, please see these images
Hi Shakeel.
I noticed we were still on version 5.1.2.0, and after the update, I've been quite busy replacing the Style property with the GetStyle and SetStyle methods throughout the project.
However, I was able to confirm that the correct label text is now reflected on the image, so I think I'll be ok from here on.
Thanks so much for your help.
Hi,
Thanks for your feedback.
Anyway, I have changed the topic of my above post, so that you or others could find it more easily. It is useful for those who want to know which of chart types and chart features are supported/unsupported by Aspose.Cells API.
Hi
Hi,
Please download and try the latest version:
Aspose.Cells
for .NET v7.1.2.2
it should fix your problems. Please let us know your feedback.
If the problem still occurs, then please provide us your source xls/xlsx file containing your chart. We will look into it and help you asap.
Hi,
I have exactly the same problem: ImageOrPrintOptions are completely ignored when transforming a chart into image.
I attached a quick project sample and the images created with it (using Aspose.Cells v7.1.2.2). Neither .emf or the .tif doesn’t have an acceptable resolution (96 dpi and text is blurred).
How we should use these saving options?
Thank you
Updating to the new assemblies did not resolve the issue.
Hi,
Thanks for your posting.
I have generated the following image using your xlsx file with the latest version:
Aspose.Cells
for .NET v7.1.2.3
Please see the code below for a reference.
I have requested the development team to look into this issue, how to improve its quality, it should look like Ms-Excel.
We have logged this issue in our database. We will look into it and once, we will get some fix or update, we will let you know asap.
This issue has been logged as CELLSNET-40511.
C#
String filePath = “F:\Shak-Data-RW\Downloads\Pie+excel.xlsx”;
Workbook workbook = new Workbook(filePath);
Worksheet worksheet = workbook.Worksheets[0];
Chart chart = worksheet.Charts[0];
Bitmap bmp = chart.ToImage();
bmp.Save(filePath + “.out.png”, ImageFormat.Png);
Thanks.
Hi
Hi,
Thanks for your posting and feedback.
We can understand your needs.
I have logged your comment in our database against the issue id: CELLSNET-40511
Hopefully, your issue will be fixed soon.