Generating Sparklines as Diagrams QGIS 2.10

This should be reasonably straightforward from the QGIS side; the harder part will be rendering the SVGs in batch. For that, R is probably as good a way as any. If JavaScript's more appealing, see this answer for an example of how to export SVG from d3.

You can create a centroid layer from your census areas, and style them as SVG symbols. As of more recent versions of QGIS, you can use expressions to build up a string representing the filename of the SVG. So as long as you stick to a naming convention (e.g. censusarea_1234.svg) you could use an expression like

'/path/to/' || 'censusarea_' || "id_field" || '.svg'

In this case, the centre of the SVG will line up with the centroid. You can add an offset, and use some fields to define these (in the same way that labelling is done)

By the looks of your screenshot, it looks like you're lining up the first data point with the centroid, in which case you'll want to do that when rendering your SVG . Easiest way is probably to subtract the first data point's x and y coordinates from each point in turn to center things. In R this would be something like xlim=c(-100,+100) and ylim=c(-100,+100) on the plot, this should center the SVG on the first point.

Another possible mechanism is SVG annotations. These can be styled to hide the bubble and just show the SVG. These have the advantage that they can be moved and deleted manually - handy if you want to tweak positions (for example, to avoid overlaps). It should be possible to use Python to add these to the canvas programatically, but I wasn't able to get this to work.


Also, one should wait for the "geometry renderer" style that will appear in QGIS 2.14 but which is accessible through the dev version.