To save to file the graph generated by a MSChart control, you must use the control’s EditCopy method to copy the image into the clipboard, and then paste it into a PictureBox control. Then, just use the SavePicture function to save the PictureBox’s content to file. Here’s an example: |
And here’s a reusable routine: |
Click here to copy the following block | Sub SaveMSChart(graph as MSChart, pic as PictureBox, ByVal fileName As String) graph.EditCopy pic.Picture = Clipboard.GetData(vbCFMetaFile) SavePicture pic.Picture, fileName End Sub |
|