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

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

Abierto
#105 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
138
Forks
76
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.