Hi Scichart Team,
RenderableSeries Hit-Test still having some issues. I saw that the bug on your board is already closed state and my last comments are missed on the bug. So i am adding the same here.
https://www.scichart.com/questions/js/renderableseries-hit-test-not-working-as-expected
Can you please check the video and the code. Only change i have done on the Example is the data values are updated. On the video you can saw the clicking outside for some area Hit is showing, some area miss is showing, and clicking on the lines or point also showing the same. Let me know you need any more inputs from my side.
- Arun Surendran asked 3 years ago
- You must login to post comments
Hi Arun,
If you need to hit-test lines you should call the hitTest function like this:
const hitTestInfo = lineSeries.hitTestProvider.hitTest(
mousePoint,
ENearestPointLogic.NearestHorizontalPoint,
HIT_TEST_RADIUS,
true
);
You should use NearestPoint2D (to find nearest point on the surface) or NearestHorizontalPoint (to find the point with nearest X value) and interpotation = true. We had a bug which manifested itself when line charts have almost vertical segments like in your example. We are calculating distance from the line and hit test result was true if to click on the line which continues the segment even if it was far away from it. It was fixed in [email protected].
However please keep in mind how the hit-test api works for line charts when NearestPoint2D and interpolation=true:
1. We find the nearest point.
2. We take adjusting point to the nearest point from the side where click was made. If click was made from the right of the nearest point the adjusting point is next to the right.
3. Two points (the line segment) give us a line and we calculate the distance. If the distance is less than HIT_TEST_RADIUS it is hit.
4. We take into account length of the line segment to exclude cases when we click on continuation of the segment far away from it. This bit was fixed.
Please refer the image.
- Michael Klishevich answered 3 years ago
- last edited 3 years ago
- You must login to post comments
Please login first to submit.