Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [swtchart-dev] Buffering Chart Data via a Bitmap

Hi Yash,

yep, that's idea. I have the following workflow in mind:

1) start zoom action
2) lock the chart and disable series plotting
3) convert current chart (BaseChart) to an image (png) via the image supplier)
4) set the image: getPlotArea().getControl().setBackgroundImage(image)
5) let the user select the range
6) stop zoom action
7) clear the image: getPlotArea().getControl().setBackgroundImage(null);
8) enable series plotting
9) unlock the chart
10) redraw

Creating the image should be relatively fast as the plot is drawn already and thus the display is available. We should give this idea a try.


Best,
Philip



Am 28.03.20 um 05:09 schrieb Yash Bharatiya:
Hi,
Currently SWTChart redraws everytime the user zooms in or out causing performance issues,

Does that mean the chart will be converted into a graphic image and then scaled or resized whenever zoomed in or out instead of redrawing?
The chart can be converted into an image using ImageSupplier class,
ImageSupplier imageSupplier = new ImageSupplier();
ImageData imageData = imageSupplier.getImageData(scrollableChart.getBaseChart());
Image image=new Image(display,imageData);
Thanks,
Yash

_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/swtchart-dev

-- 
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~

Back to the top