Using Charts in Quartz Composer

I’ve been fooling around with Quartz Composer for a couple of weeks now to create some visualizations, and given that it is utterly incapable of doing even basic graphing, I’ve been using some tricks to display charts and graphs of various descriptions.

I’ve actually been using the SAPO Chart API, but this is also applicable to Google Charts. Now, the damnedest thing was happening - I’d build the required data set, invoke the chart URL using an Image Importer patch, and the machine wouldn’t even issue an HTTP request.

But if I used a URL shortener, it issued the request, handled the redirect properly and then displayed the image. It took be a while to realize that I had to use encodeURI like so:

function (__string url) main (__string input)
    var result = new Object();
        var rawurl = 'result of computation';
    result.url = encodeURI(rawurl);
    return result;

This is a bit odd, since one would expect Composer to handle URLs properly, but I’m tossing this out there so that it shows up on Google and eventually saves someone else some time.

Note: I am aware that core-plot has a Quartz Composer plugin in its source tree, but haven’t tested it yet. It seems very interesting (although it’s overkill for the simple pie charts I need right now) and I’ll update this later if it works out for me.