from typing import Dict
import math


def hbar_line(
    length: float,
    eighths: Dict[int, str],
    eight_eighths: str,
) -> str:
    """Generate a single bar for a horizontal bar chart."""
    ret: str = ""
    rounded: float = round(length * 8) / 8 
    ret += eight_eighths * math.floor(rounded)
    ret += eighths[int((rounded - math.floor(rounded)) * 8)]
    return ret