score:1
The solution of @Keno didn't worked for me. Think because my chart needed to be min: 1000
and not min: 0
.
What worked for me was:
scales: {
yAxes: [{
display: true,
position: 'right',
ticks: {
beginAtZero: false,
max: 2000,
min: 1000,
stepSize: 100
}
}, {
display: true,
position: 'left',
ticks: {
beginAtZero: false,
max: 2000,
min: 1000,
stepSize: 100
}
}]
}
score:24
Here's one way:
your yAxes is an Array [] with objects in it {}, so you need to add another yScale to it, here an example:
scales: {
yAxes: [{
display: true,
position: 'right',
ticks: {
beginAtZero: true
}
}, {
display: true,
position: 'left',
ticks: {
beginAtZero: true,
max: 45,
min: 0,
stepSize: 5
}
}]
}
Live demo: Chart.js Double yAxis
Notice you have to reformat one of the new axis to conform to the default, you might need to format both or tie those parameters to your data if it's going to change depending on what you want it to look like.
Source: stackoverflow.com
Related Query
- Chart.js same Y axis on left and right
- How to set 3 axis in google chart (V-Axis Left as Qty, V-Axis Right as Series Column and H-Axis as TimeOrder)?
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Remove additional white space on left and right side of Angular Chart
- Labels (category type) on left and right of bar chart using chart.js?
- Chartjs: I only want left and right padding in pie chart
- How to show label at right side of Y axis same as left side of Y Axis ChartJS
- In Chart.js set chart title, name of x axis and y axis?
- Show X axis on top and bottom in line chart rendered with Chart.js 2.4.0
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- Remove left and right padding in Chart.js
- How to get rid of large left and right margins in chart.js donut chart?
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- to increase space between x axis and first horizontal bar in chart js
- Draw a horizontal bar chart from right to left
- ChartJS padding from lines left and right
- Chart.js Show Dollar Amount On Left Y And Percent Amount On Right Y
- how can i use chart.js to create a chart that has one time series line and one linear line on it at the same time?
- How To Match Left and Right Tick Intervals with Chartjs
- chart js - bar chart with time scale on Y axis in Hours and Minutes
- How to show tooltip value of all data falling on the same axis in chart js?
- Chart with Time axis only displaying first grid line and tick label (unitStepSize)
- How do you set x and y axis and Title for a line chart using charts.js?
- X and Y axis labels not displaying on line chart (Chart.js)
- Move chart x axis label and borders
- Chart.js bar chart with time on X axis and category on Y axis is not rendered
- Rails dual axis using Chartkick and chart js
- Change Chartjs financial chart yaxis from left to right
- Google Charts, HighCharts or ChartJS Dual Axis Gantt Chart and Line Chart Visualization
More Query from same tag
- Chartjs real time graph x axis movement
- Get hash value Rails / Chart JS / Google Chart
- No chart appears - Chart.js
- How to add panning to chart in chartjs?
- Tooltip overriding the text in chart js
- Chart Is Not Created
- How to skip x Axes labels in ChartJS
- How to update css for doughnut chart with ng2-charts
- How to display date as label on x-axis in chart.js
- How to set a full length background color for each bar in chartjs bar
- Chart.js - Why the chart cannot rendered in a child component but in the father component can?
- Vue.js component for Chart.js - strange issue on AJAX reload
- How to fill the gaps in an array of Dates with fixed length
- Disable tooltip for Line chart for one line
- Chart.js line chart not showing point on top most value
- How to shift the origin along y-axis direction in a chart.js3 line chart, so that x-axis pass through a different point other than (0,0)?
- Two different x-axes using charts.js and react
- ChartJS horizontal chart display legend on each bar
- Make Chart.js canvas responsive inside the resizeable div
- How to change the time format displayed in the chart?
- Can't change the default color and font size of labels in react-chartjs-2
- Chart.js label value
- Chart.js returns a console error and does not display the chart when using variables as data input
- How to create a Doughnut chart in django admin interface using foreign key field data?
- Impossible to render multiple charts with chart.js
- How to get Max Values of a Multidimensional Array for 30 Days
- npm chart.js is big after minimization
- Chartjs - Doughnut chart with multi layer and running value
- Using data saved as a variable in HTML from Python
- ChartJS chart not scaling after adding values