Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin Charts 2.0.0 Export to SVG after Zoom
Export of charts to PDF or SVG working. Export of a zoomed chart results in SVG-File with chart without zoom. The SVGGenerator uses chart configuration (chartWindow.getChart().getConfiguration()) to create SVG-File. Is there a way to get the configuration with current zoom?
public StreamSource createSVGStreamSource() {
return new StreamSource() {
@Override
public InputStream getStream() {
int width = UI.getCurrent().getPage().getBrowserWindowWidth();
int height = UI.getCurrent().getPage().getBrowserWindowHeight();
String svg = SVGGenerator.getInstance().generate(chartWindow.getChart().getConfiguration(), width, height);
if (svg != null) {
return new ByteArrayInputStream(svg.getBytes());
}
return null;
}
};
}
Hi,
I have the same problem. Does anyone know how to do this?