code: public double getChartValue(double screenPoint) {
      
      // a check if all axis data are the exact same values
      if (min == max) {
        return min;
      }
      
      double minVal = min;
      double maxVal = max;
      
      // min & max is not set in category charts with string labels 
      if (min > max) {
        if (getDirection() == Direction.X) {
          if (axesChartStyler instanceof CategoryStyler) {
            AxesChartSeriesCategory axesChartSeries =
                (AxesChartSeriesCategory) chart.getSeriesMap().values().iterator().next();
            int count = axesChartSeries.getXData().size();
            minVal = 0;
            maxVal = count;
          }
        }
      }
  
      double workingSpace;
      double startOffset;
      if (direction == Direction.X) {
        startOffset = bounds.getX();
        workingSpace = bounds.getWidth();
      } else {
        startOffset = 0; //bounds.getY();
        workingSpace = bounds.getHeight();
        screenPoint = bounds.getHeight() - screenPoint + bounds.getY(); // y increments top to bottom
      }
  
      // tick space - a percentage of the working space available for ticks
      double tickSpace = axesChartStyler.getPlotContentSize() * workingSpace; // in plot space
  
      // this prevents an infinite loop when the plot gets sized really small.
      if (tickSpace < axesChartStyler.getXAxisTickMarkSpacingHint()) {
        return minVal;
      }
  
      // where the tick should begin in the working space in pixels
      double margin =
          Utils.getTickStartOffset(
              workingSpace,
              tickSpace); 
  
      // given tickLabelPositon (screenPoint) find value
      // double tickLabelPosition =
      //       margin + ((value - min) / (max - min) * tickSpace);
      
      double value = ((screenPoint - margin - startOffset) * (maxVal - minVal) / tickSpace) + minVal;
  
      return value;
    }
docs: Converts a screen coordinate to chart coordinate value. Reverses the AxisTickCalculators calculation.
  
  @param screenPoint Coordinate of screen. eg: MouseEvent.getX(), MouseEvent.getY()
  @return value in chart coordinate system