Ported coffee charts to js


Signed-off-by: Sheik Hassan <solergiga@yahoo.com>
Make this a multi-line if/else block