Jump to content
Software FX Community

Can I pass a hashtable to out-chart?


marco.shaw
 Share

Recommended Posts

Something simple like:

$a=@{canada="1,2,3"}

Even after running get-member to determine the name of the properties, this won't work:
$a|out-chart -label keys -values values

Actually, I'm wanting to do something like this, and am wondering if it might actually work somehow:

$a|out-chart -label keys -values $a["canada"].split(',')[0],$a["canada"].split(',')[1],$a["canada"].split(',')[2]

If not, I'll have to set off in a different direction...

Link to comment
Share on other sites

We do not have any code in PowerGadgets that would allow you to retrieve data from a hashtable. this sounds interesting for future builds but I see at least the following options

- If there is 1 value per key, use the keys as labels and plot the values- If there are arrays as values, we could treat each key/array as a series or each value in the array as a different series.- Should we also handle if there are complex objects in the hash?

At this point, if you need the hash because you need to "consolidate" values, you will have to loop through your hash and create objects and then pass an array/list of these objects to out-chart.

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.

 Share

×
×
  • Create New...