ember-charts icon indicating copy to clipboard operation
ember-charts copied to clipboard

Can't get ember-charts to work

Open MarceloBorgesP opened this issue 9 years ago • 2 comments

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.

MarceloBorgesP avatar Dec 01 '15 14:12 MarceloBorgesP

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

mrosenberg avatar Dec 08 '15 18:12 mrosenberg

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

ptgamr avatar Aug 10 '16 04:08 ptgamr