access charts object inside onload callback