def get_denom(cc, related_chart=False):
    """Get the numerator and denominator map."""
    # If chart requires denominator, use it for both primary and related charts.
    if 'denominator' in cc:
        result = {}
        if len(cc['denominator']) != len(cc['statsVars']):
            raise ValueError('Denominator number not matching: %s', cc)
        for num, denom in zip(cc['statsVars'], cc['denominator']):
            result[num] = denom
        return result
    # For related chart, use the denominator that is specified in the
    # 'relatedChart' field if present.
    if related_chart and cc.get('relatedChart', {}).get('scale', False):
        return cc['relatedChart'].get('denominator', 'Count_Person')
    return None