We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Chart does not appear on doc

Hi, my chart does not appear on the doc after I update to Aspose.Word 9.4.0.

I am using Microsoft Chart and it was fine with previous version. Not sure about 9.3.0 though.
Because I did not test the chart portion after update to 9.3.0
Note that I am using MS Word 2003.
Below is the code snippet on how I insert the chart onto the doc.
----------------------------------------------------------------------------------------------------------------
c = new Chart();
ca = new ChartArea();
c.ChartAreas.Add(ca);
MemoryStream ms = new MemoryStream();
c.SaveImage(ms, ImageFormat.Emf);

builder.InsertImage(ms, Aspose.Words.Drawing.RelativeHorizontalPosition.Default, Convert.ToDouble(100),
Aspose.Words.Drawing.RelativeVerticalPosition.TopMargin, Convert.ToDouble(100),
Convert.ToDouble(600), Convert.ToDouble(400), Aspose.Words.Drawing.WrapType.None);
---------------------------------------------------------------------------
Please help and advice.

Thanks!

Hi Luke,

Thanks for your inquiry.

I cannot reproduce the issue using the latest version of Aspose.Words (9.4) and Aspose.Report (2.7). Could you please create a test project which allows me to reproduce the issue on my side.

Thanks,

Hi Adam,


Note that I am using Microsoft Chart.
using System.Windows.Forms.DataVisualization.Charting;
using System.Windows.Forms.DataVisualization.Charting.Utilities;

I am NOT using Aspose.Report.

Can you try with MS Chart?

Thanks,
luke

Hi Luke,

I was unable to reproduce any issue using Microsoft.Charts either. Are you able to post your full code and output document here for testing? I used the .NET Framework 3.5 with the additional Microsoft Chart Control DLL.

Also note, please ensure you are using a chart that has some content as by default the chart will be plain white and will look as if it is not appearing against the white background of a Word document.

Thanks,

Yes, previously was working with Aspose.Words below 9.3.0.

Anyway, I will extract out some part of my code and send to you for checking.
Give me sometime to extract out some code from my project.

Thanks,
luke

Hi Adam, I have emailed you my code.


Thanks,
luke

Hi Luke,

Thanks for sending me your project.

I was able to reproduce the issue on my side, however it seems, there is something going wrong with the Chart control itself and not anything with Aspose.Words. Saving your chart to an image on the disk also results in a near blank image.

I was able to create a small chart and insert it properly into a new Document using the same method as you are using. As you said you haven't tested the chart side of your application for a while, so most likely you have changed some of the code used to produce the chart and have not tested these changes until now. I think you will need to do a bit of inspection to find the cause of this problem.

If you have any further inquires, please feel free to ask.

Thanks,

Hi Adam,


I did not have this problem when using Aspose.Words 9.2 previously.
I have not tested on 9.3 as your 9.4 came out quite fast.
And no code has been change for the charting portion;
the only codes changed on my side is to cater for your 9.3 changes.

Please help to look thru again; while I check on the MS Chart itself.


Thanks,
luke

Hi Luke,

I have tried testing with Aspose.Words 9.4 and Aspose.Words 9.2 but encountered the issue in both versions. Please test your sample project using the DLLs from both versions and provide feedback about what happens.

Thanks,

I see.


Ok let me try it next Monday.
Currently I am out of office.

Thanks.

Hi Luke,

Sure, I'll keep my eye on this thread.

Thanks,

Hi Adam,


Sorry for the trouble;
There is a problem with the data binding part on the chart code I passed to you.

I have fixed the data portion on my actual code and now the chart is working fine.

Thanks,
luke

Hi Luke,

It's all good, I'm glad you have found the solution to your problem.

If you need any help, please feel free to ask.

Thanks,