Exporting plot to jpeg, from dynamically created TChart.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
jarp
Newbie
Newbie
Posts: 17
Joined: Thu Apr 09, 2009 12:00 am

Exporting plot to jpeg, from dynamically created TChart.

Post by jarp » Fri Jun 05, 2009 3:17 pm

Hello,

I'm using TeeChart Pro v3 for Visual Studio .NET. I have implemented the user control with TChart on it. This control is created dynamically and I don't put it on any form. I would like to export plotted graph to jpeg file. So I'm creating new object of control, setting data to plot and exporting it to file.

The problem is that the images are always 400x300 px. I have been trying to change size of control and also invoke variety methods (like Invalidate, Refresh, Update, etc) but it didn't help.

The funny thing is that, when in debug-mode I watch the control object in QuickWatch, expand TChart object property and close QuickWatch, then images are saved correctly.

So the question is: what the QuickWatch does what makes it working and what I can do with it.

Regards

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jun 05, 2009 4:01 pm

Hello jarp,

Code below works fine for me here. Can you please check if it works fine at your end?

Code: Select all

      Steema.TeeChart.TChart myChart = new Steema.TeeChart.TChart();

      myChart.Series.Add(new Steema.TeeChart.Styles.Bar());
      myChart[0].FillSampleValues();

      myChart.Export.Image.JPEG.Width = 800;
      myChart.Export.Image.JPEG.Height = 600;
      myChart.Export.Image.JPEG.Save(@"c:\temp\myChart.jpeg");
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

jarp
Newbie
Newbie
Posts: 17
Joined: Thu Apr 09, 2009 12:00 am

Post by jarp » Mon Jun 08, 2009 5:45 am

Hello,
Of course it's working...
Thanks.

Post Reply