GraphicsContext ctx = getGraphicsContext2D();
ctx.save();
double width = getWidth();
double height = getHeight();
if (width > 0 && height > 0) {
ctx.clearRect(0, 0, width, height);
this.info = new ChartRenderingInfo();
this.chart.draw(this.g2, new Rectangle((int) width, (int) height),
this.anchor, this.info);
}
ctx.restore();