Introducing charts method for toJavascript() method