def format_graph(label, count, total, percent):
	"""
	Creates an <li> element that becomes a percentage bar graph. Meant to be
	included within a <ul class="chartlist"></ul> element.
	"""
	template = """<li><span class="label">%(label)s</span><span class="count">%(percent)s%%</span><span class="index" style="width: %(percent)s%%">(%(percent)s%%)</li>"""

	return template % {'label': label, 'count': count, 'total': total, 'percent': percent}