Fixing https://github.com/novus/nvd3/issues/368 based on recommendation from menes127