def METHOD_NAME(self, template, dashboard=False):
    result = ''
    for name in self.Graphs:
        items = []
        for idx, item in enumerate(name[2]):
            zbxkey = 'pgsql.queries.sparkmes[{0}]'.format(item[0])
            if item[3] is None:
                items.append({
                    'key': zbxkey,
                    'color': item[1],
                    'yaxisside': item[2],
                    'sortorder': idx
                })
            else:
                items.append({
                    'key': zbxkey,
                    'color': item[1],
                    'yaxisside': item[2],
                    'drawtype': item[3],
                    'sortorder': idx
                })
        graph = {'name': name[0], 'items': items, 'type': name[1]}
        result += template.graph(graph)
    if not dashboard:
        return result
    else:
        return []