Update chart.coffee

Fixed state check to support older and newer versions of ember.