How to select values by scrubbing gesture

hi Team,

i want to select some data points by scrubbing i.e hold one item and sliding (while holding) over several data points
i tried using the drag and drop like below

The logic i have tried to achieve here is that click the first item and move the cursor till the last targeted item to be selected but problem is, it is not selecting the items but seems like moved the screen/swiped the screen a bit.

this is not actually dragging an item and dropping that will not happen but i am just trying to simulate the behaviour of selecting the items.

WebElement source = getElement(sourceLocator);
WebElement target = getElement(targetLocator);
Point sourcePoint = getCenter(source);
Point targetPoint = getCenter(target);
PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, “finger”);
Sequence dragNDrop = new Sequence(finger, 1);
dragNDrop.addAction(finger.createPointerMove(Duration.ofMillis(0),
PointerInput.Origin.viewport(), sourcePoint.x, sourcePoint.y));
dragNDrop.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg()));
dragNDrop.addAction(finger.createPointerMove(Duration.ofMillis(700),
PointerInput.Origin.viewport(),targetPoint.x, targetPoint.y));
dragNDrop.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg()));
driver.perform(Arrays.asList(dragNDrop));

Any suggestion would be appreciated thank you!

For example - selecting and highlighting all lines in a page by dragging over the lines
click+drag

you do not have HOLD action. try something like:

PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, “finger”);
Sequence dragNDrop = new Sequence(finger, 1);
// move cursor to start
dragNDrop.addAction(finger.createPointerMove(Duration.ofMillis(0), PointerInput.Origin.viewport(), sourcePoint.x, sourcePoint.y));
// finger down
dragNDrop.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg()));
// hold a bit on SAME point e.g. for 1 sec (i do not know how long needed to start HOLD action in your app)
dragNDrop.addAction(finger.createPointerMove(Duration.ofMillis(1000), PointerInput.Origin.viewport(), sourcePoint.x, sourcePoint.y));
// now move to needed point
dragNDrop.addAction(finger.createPointerMove(Duration.ofMillis(700), PointerInput.Origin.viewport(),targetPoint.x, targetPoint.y));
// finger up 
dragNDrop.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg()));
driver.perform(Arrays.asList(dragNDrop));

Thank you i will try this