Jump to content
Software FX Community

Need help getting data from SQL to with an InnerGauge


Recommended Posts

You will have to write a powershell script that returns an object with 2 (or more) properties, the value you want in the main gauge and the one for the inner gauge. You can find a sample of this technique here

Your script will be similar to RandomData.ps1 and you will invoke it in a very similar way to the second-to-last sample in that blog post. e.g.

.\randomdata.ps1 | out-gauge -value Sales -InnerGauges_Add Digital -InnerGauges_0_Layout_Target AnchorPoint -InnerGauges_0_Layout_AnchorPoint 0,-0.5 -InnerGauges_0_DigitalPanel_Value {$_.PrevSales}

Note that setting the LayoutTarget and the AnchorPoint properties is used to position the inner gauge.

Unfortunately it is not possible to achieve this (bind the inner gauge value or for that fact any other property but the main value) using PowerGadgets Creator but there is a trick you can use. Once you have your script returning the data you want and the gauge reading that data from powershell, you can press Ctrl-C when the gadget is the active window and then press Ctrl-V inside Creator. You will not be able to change the "binding" for the innergauge value property but you will be able to customize everything else using creator instead of typing the commands in the console window.

Hope this helps.

JuanC

Link to comment
Share on other sites

Thanks Juan,

 But I am having issues using the (trial version) PowerGadgets with PS as i keep getting: 

The term 'out-chart' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.

 

I have reinstalled PS, and PowerGadgets - but still get this am I missing some part of the installation? 

Kind regards,

Christian 

 

 

Link to comment
Share on other sites

To avoid doing this on each of your powershell sessions you can

1) Execute a shortcut we create in the Start Menu PowerGadgets. This points to a PSC1 file that will add the powergadgets snapin to the session.

2) Temporarily add this line to your profile.ps1 (<Documents>\WindowsPowerShell folder). This will apply to all sessions including if you run the PowerShell created shortcut.

JuanC

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...