added promise for the chart elements

sometimes drawChart would execute before the DOM element was available.