int width = graphPanel.getWidth(), height = graphPanel.getHeight();
rrdGraphDef.setWidth(width + deltaWidth);
rrdGraphDef.setHeight(height + deltaHeight);
rrdGraph = new RrdGraph(rrdGraphDef);
if (deltaWidth == 0 && deltaHeight == 0) {
RrdGraphInfo info = rrdGraph.getRrdGraphInfo();
deltaWidth = graphPanel.getWidth() - info.getWidth();
deltaHeight = graphPanel.getHeight() - info.getHeight();
if (deltaWidth != 0 && deltaHeight != 0) {
createRrdGraph(); // recursion is divine!
}
}
}