working on graph in html canvas