via the chart settings,
event processors can be
defined. This makes it
possible to completely
changes the events of a
chart. Three default
actions are required to
make the user selection:
The user selection is
handled after mouse up
event here:
org.eclipse.swtchart.extensions.core.BaseChart
private void
handleUserSelectionXY(Event
event) {
/*
* Track the selection
before the new range is
* selected by the user.
*/
trackUndoSelection();
int xStart =
userSelection.getStartX();
int xStop =
userSelection.getStopX();
int yStart =
userSelection.getStartY();
int yStop =
userSelection.getStopY();
setSelectionXY(xStart,
xStop, yStart, yStop);
trackRedoSelection();
/*
* Inform all registered
handlers.
* Reset the current
selection and redraw the
chart.
*/
fireUpdateCustomRangeSelectionHandlers(event);
}
Best,
Philip
Am 31.03.20 um 07:32
schrieb Yash Bharatiya:
Hi,
I tried
implementing the
above mentioned idea
and looked into the
code base,
I used
suspendUpdate() to
lock the chart and
the series plotting
,but I am having
difficulty in
understanding how
the scrollable chart
handles various
events.
Could you briefly
explain how event
handling is done in
the scrollable
chart.
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,
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~