Search code examples
teechart

NearestPoint does not work with points very close to axis


I am using NearestPoint which reports the x/y values in a jlabel, but I have noticed that if I hover over a point that is on the edge of the chart [extremely close to any axis] that it is not detected by NearestPoint. Is there a way round this problem or how can I create space between the edge of the chart and the points?


Solution

  • Is there a way round this problem

    This works fine for me here. Can you please send us a simple example project we can run "as-is" to reproduce the problem here? You can send it at http://www.steema.net/upload/

    or how can I create space between the edge of the chart and the points?

    You can use axis minimum and maximum offset, for example:

        tChart1.getAxes().getBottom().setMinimumOffset(10);
        tChart1.getAxes().getBottom().setMaximumOffset(10);