docs: function (index, xy) {
              var show = true,
                axis = this.axis,
                isFirst = this.isFirst,
                isLast = this.isLast,
                horiz = axis.horiz,
                pxPos = horiz ? xy.x : xy.y,
                reversed = axis.reversed,
                tickPositions = axis.tickPositions,
                sides = this.getLabelSides(),
                leftSide = sides[0],
                rightSide = sides[1],
                axisLeft,
                axisRight,
                neighbour,
                neighbourEdge,
                line = this.label.line,
                lineIndex = line || 0,
                labelEdge = axis.labelEdge,
                justifyLabel = axis.justifyLabels && (isFirst || isLast),
                justifyToPlot;
  
              // Hide it if it now overlaps the neighbour label
              if (labelEdge[lineIndex] === UNDEFINED || pxPos + leftSide > labelEdge[lineIndex]) {
                  labelEdge[lineIndex] = pxPos + rightSide;
  
              } else if (!justifyLabel) {
                  show = false;
              }
  
              if (justifyLabel) {
                  justifyToPlot = axis.justifyToPlot;
                  axisLeft = justifyToPlot ? axis.pos : 0;
                  axisRight = justifyToPlot ? axisLeft + axis.len : axis.chart.chartWidth;
  
                  // Find the firsth neighbour on the same line
                  do {
                      index += (isFirst ? 1 : -1);
                      neighbour = axis.ticks[tickPositions[index]];
                  } while (tickPositions[index] && (!neighbour || !neighbour.label || neighbour.label.line !== line)); // #3044
  
                  neighbourEdge = neighbour && neighbour.label.xy && neighbour.label.xy.x + neighbour.getLabelSides()[isFirst ? 0 : 1];
  
                  if ((isFirst && !reversed) || (isLast && reversed)) {
                      // Is the label spilling out to the left of the plot area?
                      if (pxPos + leftSide < axisLeft) {
  
                          // Align it to plot left
                          pxPos = axisLeft - leftSide;
  
                          // Hide it if it now overlaps the neighbour label
                          if (neighbour && pxPos + rightSide > neighbourEdge) {
                              show = false;
                          }
                      }
  
                  } else {
                      // Is the label spilling out to the right of the plot area?
                      if (pxPos + rightSide > axisRight) {
  
                          // Align it to plot right
                          pxPos = axisRight - rightSide;
  
                          // Hide it if it now overlaps the neighbour label
                          if (neighbour && pxPos + leftSide < neighbourEdge) {
                              show = false;
                          }
  
                      }
                  }
  
                  // Set the modified x position of the label
                  xy.x = pxPos;
              }
              return show;
          }