Reputation: 51
Change Chartjs financial chart yaxis from left to the right, tried this code but didnt work:
scales: { yAxes: [{ display: true, position: 'right' }] }
https://www.chartjs.org/chartjs-chart-financial/
Upvotes: 0
Views: 596
Reputation: 31341
add position right to the first (default) yAxes object in the options
options: {
scales: {
yAxes: [{
position: 'right'
}]
}
}
EDIT: Seems like chartjs financial is working with v3 of the lib. In v3 you have to edit the axis in a different way:
options: {
scales: {
y: {
position: "right"
}
}
}
Upvotes: 1
Reputation: 59
scales: {yAxes: [{
display: true,
position: 'right',
ticks: {
beginAtZero: false,
max: 2000,
min: 1000,
stepSize: 100
}}]}
scales: { yAxes: [{
display: true,
position: 'right',
ticks: {
beginAtZero: true
},}]}
you can try these two ways, one of the them will work, depends on the your chart.
Upvotes: 0