Jump to content
Software FX Community

How to output a PFG chart to a bitmap (PNG)?


PSaul

Recommended Posts

Hello,

I've been trying out PowerGadgets, and my company recently purchased 7 licences. Or primary use for it is to visually display data from our help-desk software, which runs SQL. I have created several PowerGadget PFG files with the Creator. However I'd like to create a "dashboard" with several of the gadgets arranged so that I can easily bring them all up or minimize them, without having to deal with 10 different charts/gauges.

 And idea suggested was to output the Gauges/Charts to bitmap/PNG format and build a webpage that displays the pictures. I could then get the page to auto-refresh every 5 minutes or so, and have a script that re-exports the Charts to bitmaps so the page will update. (I could even set it so that clicking on one of the pictures would launch the correct chart "live").

My issue: I can't see how to make PGF files export out to PNG files. I know I can do it with the PowerShell out-chart cmdlet and the -output switch, but I tried:

PowerGadgets.Presenter.exe "c:\temp\My Custom Chart.pgf" -output c:\test.png

It just displayed the Chart (or sometimes it just displayed some random line chart for some reason).

Is there a way to export the output of a PGF to a bitmap, like a PNG file?

Or, is there a way I can pass a PGF file (which is just an XML) to the out-chart cmdlet and then use the -output switch?

I would really rather not have to work out how to redo all my Gadgets as PowerShell out-chart and out-gauge commands. I spent a fair bit of time getting them looking just the way I want them. And since all the data comes from SQL anyway there is no real need.

Any one able to offer some command line switches that will do what I want? Or could SoftwareFX be willing to add the -output switch to the PowerGadgets.Presenter.exe executable?

 Thanks so much,

--Saul

post-7253-13922412983318_thumb.png

Link to comment
Share on other sites

If I follow correctly, have you tried something simple like this:

PS>out-chart -template my_chart.pgf -output my_chart.png

Now, oddly enough, it seems this method *might* lose some of the formatting, but could you give it a try with your examples?

I like how you're using the product...  Please feel free to post if you have any more questions!

Link to comment
Share on other sites

That sounds like it would work, but it doesn't. I tried:

PS> out-chart -template "Today's Time Sheet.pgf" -output c:\test.png

And it just outputs a random line chart, with 3 lines. I tried without the -output and it displayed the same chart. I tried moving the PFG to My Documents (the guide sort if implies that's where they're kept) but it didn't help. It's like it's showing an example chart.

In fact, when I do just: out-chart -output c:\test.png   it displays a random bar chart. And if I misspell the PGF file name I get the same random bar chart. So I know it's reading the PGF file but it's not actually using it to display anything. (the chart is a stacked bar-chart)

I tried with a gauge PGF and it said "WARNING: The specified file is not a gauge template"

Any other ideas? Could this be added in a future (soon?) release? I think it would be very useful, esp. since the functionality is already there for the PowerShell cmdlets.

And it would be handy to be able to quickly group a bunch of gadgets together to make a dashboard.

Or add a -display or -input switch to the out-chart and out-gauge cmdlets to let us specify a prebuilt PGF file. Either would work, which ever is simpler.

Or do you think there is something I need to change/edit in my PGF file to allow it to work as a template?

--Saul

Link to comment
Share on other sites

  • 2 weeks later...

Yes, please let me know. I think it could be something others would be interested in too. Both being able to pass PGF files to the cmdlets and/or being able to output a PGF file to bitmap. The features are there, they just need to be connected! :)

 Or a simple way to convert between PGF and a list of cmdlet options.

 --Saul

Link to comment
Share on other sites

  • 4 weeks later...

PowerGadgets have 2 personalities:

1) PowerShell: Out-Chart, Out-Gauge: these cmdlets allow you to pass Powershell objects, customize the visual attributes using the command line and optionally save/load a template file to reuse these customizations. Note that although we allow you to "send" a chart/gauge to an existing gadget, they still only know about 1 element. We do support exporting to files using these cmdlets.

2) PGF: An xml file that contains 1 or more elements (charts, gauges, etc.), you can run these by double clicking them. In this case you are not using cmdlets (unless you are connecting the elements to powershell data, but you are not using out-chart/out-gauge). Note that a single PGF supports more than 1 chart/gauges (with a next-previous metaphor).

Currently we do not allow you to export an image when running a PGF file, we will definitely consider adding this for the next version (which will include some interesting new features) but it would probably only work if the PGF in question only has 1 element as we currently only display one item at a time.

JuanC

 

Link to comment
Share on other sites

Currently we do not allow you to export an image when running a PGF file, we will definitely consider adding this for the next version (which will include some interesting new features) but it would probably only work if the PGF in question only has 1 element as we currently only display one item at a time.

JuanC

Yes, even if it was just one element it would be super handy. Do you know when this next version might be released?

What I am wondering really is: Is it worth re-coding all of my PGF charts as PowerShell out-charts? Or if the next version which could export a PGF file to a bitmap is just around the corner then it's not worth my time.  (unless there is a simple way to convert)

Thanks,

--Saul

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...