hello,
I have a problem...
I get a point by muose click, and I need to know if this point is near a chart point (dataset point), see the image :
I have a point and a dataset, there is a way to know the dataset point nearest ?
how get the distance between two points
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Only by iterating through all the data items in the dataset and computing the "distance" for each one. And distance could be defined in Java2D space OR in data-space (if the axis scales are different, which is the normal case).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program