Moved chart drawing to document.ready event.