code: private void drawYValues(Graphics2D chartGraphics) {
      if (!showYAxisValues) {
        return;
      }
  
      chartGraphics.setColor(axisValuesColour);
  
      for (int i = 0; i < yValues.length; i++) {
        if (i % yAxisValuesFrequency != 0) {
          continue;
        }
  
        String yValueStr = yValues[i].toString();
  
        chartGraphics.setFont(axisValuesFont);
        FontMetrics metrics = chartGraphics.getFontMetrics();
  
        int valueWidth = metrics.stringWidth(yValueStr);
  
        if (yValuesHorizontal) {
          // Draw the value with whatever font is now set.
          int valueXPos = margin + yAxisLabelSize.height + (yAxisValuesWidthMax - valueWidth);
          int valueYPos = heatMapTL.y + (i * cellSize.height) + (cellSize.height / 2)
              + (yAxisValuesAscent / 2);
  
          chartGraphics.drawString(yValueStr, valueXPos, valueYPos);
        }
        else {
          int valueXPos = margin + yAxisLabelSize.height + yAxisValuesAscent;
          int valueYPos = heatMapTL.y + (i * cellSize.height) + (cellSize.height / 2)
              + (valueWidth / 2);
  
          // 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(yValueStr, valueXPos, valueYPos);
  
          // Revert to original transform before rotation.
          chartGraphics.setTransform(originalTransform);
        }
      }
    }
docs: /*
  Draws the y-values onto the y-axis if showYAxisValues is set to true.