Page 1 of 1

Exporting plot to jpeg, from dynamically created TChart.

Posted: Fri Jun 05, 2009 3:17 pm
by 13052929
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

Posted: Fri Jun 05, 2009 4:01 pm
by narcis
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");

Posted: Mon Jun 08, 2009 5:45 am
by 13052929
Hello,
Of course it's working...
Thanks.