// data table. in particular, we want to inherit the x,y coordinates.
m_vis.addDerivedTable(LABELS, DATA, loneResult, getLabelSchema());
// -- renderers -------------------------------------------------------
DefaultRendererFactory rf = new DefaultRendererFactory();
rf.setDefaultRenderer(new ShapeRenderer(1)); // 1 pixel rectangles
rf.add("INGROUP('labels')", new LabelRenderer("label") {
public Shape getShape(VisualItem item) {
// set horizontal alignment based on x-coordinate position
setHorizontalAlignment(item.getX()>getWidth()/2 ? RIGHT:LEFT);
// now return shape as usual
return super.getShape(item);