I am trying to export a JPEG image of a pie chart I have created. If I do not resize the image, it looks great - but if a try to resize the Chart it is unreadable - pie shape changes radically or disappears, etc.
Code I use in Visual FoxPro (VFP):
With thisform.mmTeeChart_Pie.Export.asJPEG
.CompressionQuality = 90
.GrayScale = .F.
.Height = 105
.Width = 120
.SaveToFile("c:\pie.jpg")
ENDWITH
All I want is an image that looks EXACTLY like the bigger version - only smaller (like a thumbnail). Maybe just specify width and be able to use "Keep Aspect Ratio" type command to calculate the height. Is that possible?
Export & Resize JPEG Image of Chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tom,
This is because chart's legend and pie's mark don't let the pie be visible you can do something like this:
This is because chart's legend and pie's mark don't let the pie be visible you can do something like this:
Code: Select all
Private Sub Command1_Click()
TChart1.Legend.Visible = False
TChart1.Series(0).Marks.Visible = False
With TChart1.Export.asJPEG
.CompressionQuality = 90
.GrayScale = False
.Height = 105
.Width = 120
.SaveToFile ("c:\temp\pie.jpg")
End With
TChart1.Legend.Visible = True
TChart1.Series(0).Marks.Visible = True
End Sub
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |