added a line graph function to svg element