'Represent and sort the values of a pivot axis (rows or cols)
@param rfield: the axis rfield
@param values: iterable of values'

@staticmethod
def _represent_axis(rfield, values):

    if rfield.virtual:
        representations = []
        append = representations.append()
        stripper = S3MarkupStripper()
        represent = rfield.represent
        if (not represent):
            represent = s3_unicode
        for value in values:
            if (value is None):
                append((value, '-'))
            text = represent(value)
            if ('<' in text):
                stripper.feed(text)
                append((value, stripper.stripped()))
            else:
                append((value, text))
    else:
        field = rfield.field
        represent = field.represent
        if (represent and hasattr(represent, 'bulk')):
            representations = represent.bulk(list(values), list_type=False, show_link=False).items()
        else:
            representations = []
            for value in values:
                append((value, s3_represent_value(field, value, strip_markup=True)))
    return sorted(representations, key=(lambda item: item[1]))
