Jump to content


Photo

PrintGraph()


  • Please log in to reply
5 replies to this topic

#1 echoi

echoi

    Member

  • Members
  • PipPip
  • 13 posts

Posted 29 May 2012 - 11:49 AM

components.mygraph.printgraph()

brings up export dialog box.

is there a means to script so there is no user interface?
as in components.mygraph.printgraph("Filename",BMP)?

#2 AzeoTech

AzeoTech

    Guru

  • Administrators
  • PipPipPipPipPip
  • 4641 posts

Posted 31 May 2012 - 09:18 AM

To capture a graph to image file from script you'd have to use the page.capture() function. That function allows you to specify the coordinates of the graph so you can trim the capture to just the graph. This function is described in section 7.14 of the user's guide. Note that it requires DAQFactory Standard or higher I believe.

#3 echoi

echoi

    Member

  • Members
  • PipPip
  • 13 posts

Posted 04 October 2012 - 01:12 PM

is there a way to save it in wmf format? it's cleaner to include it in my report.

#4 AzeoTech

AzeoTech

    Guru

  • Administrators
  • PipPipPipPipPip
  • 4641 posts

Posted 04 October 2012 - 01:31 PM

Sure, right click on the graph and select "Export", then select the "MetaFile" option, along with "File" for the destination.

You can programmatically trigger this dialog by using the following line of script:

component.myGraph.printGraph()

where myGraph is the name you gave the graph.

#5 Jonessy

Jonessy

    Member

  • Members
  • PipPip
  • 13 posts

Posted 18 October 2012 - 03:32 AM

I would like to print graph from script just like I can do it from export/print menu, so just scaled to graph area, not to hole page and PDF format would be great. Can this be done?

#6 AzeoTech

AzeoTech

    Guru

  • Administrators
  • PipPipPipPipPip
  • 4641 posts

Posted 18 October 2012 - 12:56 PM

And not use printGraph()? You should duplicate the graph on another page without any of the ancillary stuff, the use page.printPage() to print the page. Note that you'll need to show that page at least once for it to print.