Addepar / ember-charts

https://opensource.addepar.com/ember-charts/
Other
784 stars 131 forks source link

Can't get ember-charts to work #140

Open MarceloBorgesP opened 8 years ago

MarceloBorgesP commented 8 years ago

Hey guys, I've been trying to use ember-charts for a while now, but I can't get it to work, I suppose it could be some sort of deprecation, but as I'm still learning ember I think I should report it.

This is my route:

import Ember from 'ember';

export default Ember.Route.extend({
  model: function() {
    return [
        {
            "time": d3.time.format('%Y-%m-%d').parse("2013-05-01"),
            "value": 40
        },
        {
            "time": d3.time.format('%Y-%m-%d').parse("2013-05-02"),
            "value": 80
        },
        {
            "time": d3.time.format('%Y-%m-%d').parse("2013-05-03"),
            "value": 120
        }
    ];
  }
});

And in my template, I've used:

<div class="chart-container">
  {{time-series-chart lineData=model}}
</div>

I'm using this example: https://github.com/Addepar/ember-charts/issues/1 as a base, it's a bit old but I think it's still valid.

When I try to open the page, I'm getting this error in the console:

Uncaught Error: Assertion Failed: Depending on arrays using a dependent key ending with `@each` is no longer supported. Please refactor from `Ember.computed('_groupedBarData.@each', function() {});` to `Ember.computed('_groupedBarData.[]', function() {})`.

I know it would be better to ask for help on stackoverflow, but I'm wondering if it is not something wrong with ember-charts.

I don't know if it's something I'm doing wrong, if so, please tell me.

mrosenberg commented 8 years ago

You need to do a search and replace on '.@each' and replace with '.[]'. That will solve your problem until you NPM update.

ptgamr commented 8 years ago

This is also preventing me to use this library. Please have a fix ...