Modularized JS. Chart fully working