use of org.jfree.chart.fx.overlay.OverlayFX in project jfreechart-fx by jfree.
the class ChartCanvas method draw.
/**
* Draws the content of the canvas and updates the
* {@code renderingInfo} attribute with the latest rendering
* information.
*/
public final void draw() {
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();
if (this.chart != null) {
this.chart.draw(this.g2, new Rectangle((int) width, (int) height), this.anchor, this.info);
}
}
ctx.restore();
for (OverlayFX overlay : this.overlays) {
overlay.paintOverlay(g2, this);
}
this.anchor = null;
}
Aggregations