Community
Participate
Working Groups
From bug 262603: * Charts: Rewrote to use PNG renderer instead of SWT. This was necessary as RAP does not support a full-fledged GC to support all BIRT needs. Instead of drawing the chart onto a canvas, we now just create the image file and use a Label to display it.
Using the changes in https://bugs.eclipse.org/bugs/attachment.cgi?id=187550&action=diff#src/org/eclipse/mat/ui/internal/chart/ChartCanvas.java_sec1 as a guide this can be done. Modifications - RAP now has paint events, so that doesn't need to be changed. renderer.setProperty(IDeviceRenderer.FILE_IDENTIFIER can now take an OutputStream as well as a File, so we can use a ByteArrayOutputStream and avoid the temporary file. To aid single sourcing, we can try the dv.SWT renderer first, then if that fails go to dv.PNG and do the RAP processing. The org.eclipse.birt.chart.device.swt bundle can be optional - so the code can work as before with RCP. As with the example patch, setting the background image on the canvas works - no need for a label. Limitation - with the PNG renderer there is no hover selection of a item in the pie chart as inspector view item.
New Gerrit change created: https://git.eclipse.org/r/c/mat/org.eclipse.mat/+/199996
Gerrit change https://git.eclipse.org/r/c/mat/org.eclipse.mat/+/199996 was merged to [master]. Commit: http://git.eclipse.org/c/mat/org.eclipse.mat.git/commit/?id=fed0ec3ee84a069e3d11980d8fc185b055572090