fix legend and circlegraph type sorting