i wouldn't recommend that ... javascript has no drawing abilities and you had to do some dhtml/css tricks to simulate a drawing with javascript ... you may use divs that you position in a self-contained coordinate-system (may be another div) ... so when you need a bargraph i think that might be done quite simple ... and that seems to be ok ... but 'drawing' lines is a misuse of javascript ... :) ... you may use SVG, flash or a serverside solution to create graphs ... which would be much better ...
kind regards