nnnick/Chart.js — pull request #621 by fntneves (2014-09-10 18:48:57+00:00)
Title: Fix infinity on first addData() call in Bar chart

Fixes Issue https://github.com/nnnick/Chart.js/issues/620

When first addData() was called, variable valuesCount was 0, because addXLabel(), which is responsible to increment valuesCount, happened only after calculateX(). This is the reason to raise a DOMException because of division by zero, on calculateX() function.

This only affects addData().

There is the bug and the fix:
Bug: http://jsbin.com/rozepubikecu/1/edit
Fix: http://jsbin.com/rozepubikecu/5/edit