def _create_statistics_data(data_list, is_multi_series=False):
    """
    Transforms the given list of data to the format suitable for
    presenting it on the front-end. Supports multi series charts (like
    line and bar charts) and or single series ones (like pie/donut
    charts).

    :param data_list: a list of pairs (label, value)
    :param is_multi_series: true if data will be shown on multi series
    charts
    :return: a dictionary of formatted input data
    """

    statistics_data = {
        'labels': [],
        'series': [[]] if is_multi_series else []
    }

    for data in data_list:
        statistics_data['labels'].append(data[0])

        if is_multi_series:
            statistics_data['series'][0].append(data[1])
        else:
            statistics_data['series'].append(data[1])

    return statistics_data