Several people have blogged about using the Google charts api from PowerShell, but everyone seems to be using the “simple” numerical encoding, so I figured that as the first step of my own google chart api wrapper module I would start out by writing up a simple encoder. I’m not posting this to the script repository until I’m done with it — this is just the number encoding function.
But I figured I’d blog it here in case it will help anyone else write the full wrapper module “for” me before I get around to it
In any case, remember this doesn’t encode numbers higher than 4095, so if you have a bunch of numbers and some of them might be larger than that, you’ll still need to normalize them so they are within that range. I’ll post the function to normalize a series of numbers later this evening, because for some reason I can’t find it right now, but I’m sure I already wrote it
.
That’s the whole thing … it’s really only about three lines of code (including the definition of $ody), but the rest is necessary to make it handle parameters or pipeline values.