def get_layout(data, width_limit):
    """A row of a chart can be dissected as four components below:

    1. Label region ('label1'): fixed length (set to max label length + 1)
    2. Intermediate region (' | '): 3 characters
    3. Bar region ('▇ or '): variable length

    This function first calculates the width of label region(1),
    and compute the longest of the lengths of bar(3) regions.
    Then returns the layout of the chart, which is described by the widths of
    each regions.

    The total widths of the chart will not exceed width_limit-15 characters, just for an
    aesthetic reason.
    """
    labels = [d[0] for d in data]
    label_width = len(max(labels, key=lambda label: len(label))) + 1
    intermediate_width = 3
    bar_width = (width_limit - 15) - (label_width + intermediate_width)

    return label_width, bar_width