Skip to content

Instantly share code, notes, and snippets.

@constructor-igor
Created November 26, 2014 13:00
Show Gist options
  • Save constructor-igor/18e88b456833f3dc9d7f to your computer and use it in GitHub Desktop.
Save constructor-igor/18e88b456833f3dc9d7f to your computer and use it in GitHub Desktop.
powershell: google chart api sample (small numbers, scaling)
#
# sample:
#$title = "MyChart"
#$size = "700x350"
#$url = CreateChartUrl $valueArray $labelArray $title $size
#
function CreateChartUrl ($valueArray, $labelArray, [string]$title, $size) {
$chartType = "lc"
$chartData = [string]::join(",", $valueArray)
$chartLabel = [string]::join("|", $labelArray)
Write-Output "http://chart.apis.google.com/chart?chtt=$title&cht=$chartType&chd=t:$chartdata&chs=$size&chl=$chartLabel&chds=a&chxt=y"
}