I would recommend using Flash for your task. Is there any reason why you want to use JS?
Especially in Flash MX there is a free component that can do pie-, line- and bar charts with a few clicks. And with the ability of Flash to dynamically create objects and load data from a server you can even fetch the data from somewhere else (e.g. outside of Flash in a text file or even a php script).
Do not misunderstand me, I am not telling you, that it is impossible to do it in JS, but IMHO it is far more convenient, easier, plattform- and browser-independant and faster to use Flash.