List of usage examples for org.jfree.chart.fx ChartViewer snapshot
public WritableImage snapshot(SnapshotParameters params, WritableImage image)
From source file:io.github.mzmine.util.jfreechart.JFreeChartUtils.java
public static void exportToClipboard(ChartViewer chartNode) { final Clipboard clipboard = Clipboard.getSystemClipboard(); final ClipboardContent content = new ClipboardContent(); final int width = (int) chartNode.getWidth(); final int height = (int) chartNode.getHeight(); WritableImage img = new WritableImage(width, height); SnapshotParameters params = new SnapshotParameters(); chartNode.snapshot(params, img); content.putImage(img);/*from w w w.j av a 2s.c o m*/ clipboard.setContent(content); }