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

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

オープン
#105 コメント 3 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。