added js to draw charts. (untested)