Fixed JS error on touching pie charts in iOS Safari. Closes #1861.