'If bar style is specified, fill in the missing data and apply it.'

def _ApplyBarChartStyle(self, chart):

    if ((chart.style is None) or (not chart.data)):
        return {}
    (bar_thickness, bar_gap, group_gap) = (chart.style.bar_thickness, chart.style.bar_gap, chart.style.group_gap)
    if ((bar_gap is None) and (group_gap is not None)):
        bar_gap = max(0, (group_gap / 2))
        if (not chart.style.use_fractional_gap_spacing):
            bar_gap = int(bar_gap)
    if ((group_gap is None) and (bar_gap is not None)):
        group_gap = max(0, (bar_gap * 2))
    if (bar_thickness is None):
        if chart.style.use_fractional_gap_spacing:
            bar_thickness = 'r'
        else:
            bar_thickness = 'a'
    elif chart.style.use_fractional_gap_spacing:
        if bar_gap:
            bar_gap = int((bar_thickness * bar_gap))
        if group_gap:
            group_gap = int((bar_thickness * group_gap))
    spec = [bar_thickness]
    if (bar_gap is not None):
        spec.append(bar_gap)
        if ((group_gap is not None) and (not chart.stacked)):
            spec.append(group_gap)
    return util.JoinLists(bar_size=spec)
