Jump to content
Software FX Community

out-chart


DungKHoang

Recommended Posts

Posted

Hi,

 Out-chart is a really cool powered gadget!

I'd like to know whether you can use calculated expressions for parameters like -Value or -Label

Example

PS C:\> import-csv employees.csv | out-chart -value Age*10 -Label ("Mr or Mrs " + Name) 

Thanks!

/Dung

 

Posted

Although we support expressions in almost any parameters in out-gauge, we do not support them in out-chart yet. We will investigate if we can include this functionality for V1 but in the meantime you can use the following workaround.

1) import-csv employees.csv | select {[int]$_.Age*2},{"Mr or Mrs "+$_.Name} | out-chart

We are using the select command to create 2 new calculated properties. In order to get a numerical value we had to cast $_.Age to an integer as import-csv returns all fields as strings. Also note that out-chart will not automatically pick up the labels (something we expect to fix in future builds) and the title for the series will be the expression.

2) import-csv employees.csv | select @{Expression={[int]$_.Age*2};Name="CorrectedAge"},@{Expression={"Mr or Mrs "+$_.Name};Name="CorrectedName"} | out-chart -values CorrectedAge -label CorrectedName

We are now using a powershell feature that allows us to attach a symbolic name to each calculated expression, note that there is a bug in out-chart (already fixed in our internal build) that will make it ignore the CorrectedName property. This will be fixed in our next public build.

Regards,

JuanC

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...