Hi all,
Several days ago someone posted a question about clicking on lines. I did some more research and came up with the following:
Graphics2D has a method hit(Rectangle, Shape, boolean) that checks if Reactangle intersects with Shape.
What I did for now is to get the EntityCollection of a chart and iterate over it, creating lines for every point. Check if a small Rectangle (where the center of that rectangle is the point of the mouse click) "hit"s that line and if so, do something with it.
It the previous post of clicking on lines I allready asked what the best place would be to add this code. I think something similar as EntityColletion would be the best. So a new class LinesCollection would be created, and placed in ChartRenderingInfo. Also something like LineEntity would be needed (similar to ChartEntity).
Am I missing some things? Or is this a good way to solve the Clicking on Lines problem?
TiA,
Alexander