code: function drawItemLabels(legend, barGroup) {
    // draw a subtle tick to help indicate what the label refers to
    function drawTick(y) {
      barGroup.appendChild(
        svgElement(
          legend,
          "line",
          {
            x1: legend.itemWidth,
            x2: legend.itemWidth + 5,
            y1: y,
            y2: y
          },
          "tick-mark"
        )
      );
    }
  
    function drawLabel(y, text) {
      var textOffsetX = 7;
      var textOffsetY = 3; // pixel shuffling to get the text to line up just right.
      barGroup.appendChild(
        svgElement(
          legend,
          "text",
          {
            x: legend.itemWidth + textOffsetX,
            y: y + textOffsetY
          },
          "item-label" + (legend.items.length > 6 ? "-small" : ""),
          text
        )
      );
    }
  
    legend.items.forEach(function(item, i) {
      var y = itemY(legend, i);
      if (defined(item.titleAbove)) {
        drawLabel(y, item.titleAbove);
        drawTick(y);
      }
      if (defined(item.title)) {
        drawLabel(y + legend.computedItemHeight / 2, item.title);
      }
      if (defined(item.titleBelow)) {
        drawLabel(y + legend.computedItemHeight, item.titleBelow);
        drawTick(y + legend.computedItemHeight);
      }
    });
  
    return itemY(legend, -1);
  }
docs: /*
  Label the thresholds between bins for numeric columns, or the color boxes themselves in other cases.