draw graph from record