code: private void drawXValues(Graphics2D chartGraphics) {
      if (!showXAxisValues) {
        return;
      }
  
      chartGraphics.setColor(axisValuesColour);
  
      for (int i = 0; i < xValues.length; i++) {
        if (i % xAxisValuesFrequency != 0) {
          continue;
        }
  
        String xValueStr = xValues[i].toString();
  
        chartGraphics.setFont(axisValuesFont);
        FontMetrics metrics = chartGraphics.getFontMetrics();
  
        int valueWidth = metrics.stringWidth(xValueStr);
  
        if (xValuesHorizontal) {
          // Draw the value with whatever font is now set.
          int valueXPos = (i * cellSize.width) + ((cellSize.width / 2) - (valueWidth / 2));
          valueXPos += heatMapTL.x;
          int valueYPos = heatMapBR.y + metrics.getAscent() + 1;
  
          chartGraphics.drawString(xValueStr, valueXPos, valueYPos);
        }
        else {
          int valueXPos = heatMapTL.x + (i * cellSize.width)
              + ((cellSize.width / 2) + (xAxisValuesHeight / 2));
          int valueYPos = heatMapBR.y + axisThickness + valueWidth;
  
          // Create 270 degree rotated transform.
          AffineTransform transform = chartGraphics.getTransform();
          AffineTransform originalTransform = (AffineTransform) transform.clone();
          transform.rotate(Math.toRadians(270), valueXPos, valueYPos);
          chartGraphics.setTransform(transform);
  
          // Draw the string.
          chartGraphics.drawString(xValueStr, valueXPos, valueYPos);
  
          // Revert to original transform before rotation.
          chartGraphics.setTransform(originalTransform);
        }
      }
    }
docs: /*
  Draws the x-values onto the x-axis if showXAxisValues is set to true.