You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I've passed in a custom callback to a Line Chart for the yAxes tick labels and it is being ignored.
To Reproduce
Steps to reproduce the behavior:
Set ->options('scales => [ 'yAxes' => ['ticks' => ['callback' => 'function(value){return '$' + value}']]]) (or any other callback)
Expected behavior
Y-axis tick labels should be customized based on the callback return value
Screenshots
If applicable, add screenshots to help explain your problem.
Dependencies Version (please complete the following information):
Laravel Version: 9.11
Nova Version: 4.22
Nova-ChartJS Version: 0.4.0
Desktop (please complete the following information):
OS: Mac OS
Browser firefox
Version
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
I believe the issue is that in the underlying StripeChart.vue on line 126, ticks.callback is being set to a default implementation AFTER ...this.card.options.scales?.yAxes?.ticks || {} is set on line 121, so any attempt to set the callback would be overwritten by the default implementation. Setting the default implementation first before the spread or checking for the existence of one before overwriting should fix this I believe. I did not look at the other chart types to see if the problem was consistent.
The text was updated successfully, but these errors were encountered:
Describe the bug
I've passed in a custom callback to a Line Chart for the yAxes tick labels and it is being ignored.
To Reproduce
Steps to reproduce the behavior:
->options('scales => [ 'yAxes' => ['ticks' => ['callback' => 'function(value){return '$' + value}']]])
(or any other callback)Expected behavior
Y-axis tick labels should be customized based on the callback return value
Screenshots
If applicable, add screenshots to help explain your problem.
Dependencies Version (please complete the following information):
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
I believe the issue is that in the underlying
StripeChart.vue
on line 126,ticks.callback
is being set to a default implementation AFTER...this.card.options.scales?.yAxes?.ticks || {}
is set on line 121, so any attempt to set the callback would be overwritten by the default implementation. Setting the default implementation first before the spread or checking for the existence of one before overwriting should fix this I believe. I did not look at the other chart types to see if the problem was consistent.The text was updated successfully, but these errors were encountered: