adopted-ember-addons / adopted-ember-addons/ember-cli-chart

updating options does not override scales.yAxes[0].ticks.callback

未关闭
#105 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
138
派生
76
PR 合并指标
30 天内没有已合并 PR

描述

Hello,

I have embedded ember-cli-chart in my hbs file as

```hbs


{{ember-chart type='line' data=data options=options}}

```

In my component file I have created an **options** property as
```javascript
options: computed('metric', function() {
let opts = defaultOptions;
if (this.metric === 'height') {
opts.scales.yAxes = [{
ticks: {
callback: function(value, index, values) {
// code to return labels
}
}
}]
} else {
opts.scales.yAxes = [{
ticks: {
callback: function(item, index, items) {
// code to return labels
}
}
}]
return opts;
}
});
```

So when first time chart loads it renders correct labels and if I change the metric then the same callback is getting used and renders same labels but with updated data values.
Can anyone help on this?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。