score:0
you can simply set a max for the y axes. e.g.
var maxy = 100;
....
scales: {
yaxes: [{
id: 'a',
type: 'linear',
ticks: {
.....
max: maxy
},
}]
....
}
here the snippet:
https://jsfiddle.net/lx9unv47/
also if you don't want to set the max of the y axes manually you can do this:
var allvalues = data.datasets[0].data.concat(data2.datasets[0].data);
var maxy = math.max(...allvalues);
and here the fiddle: https://jsfiddle.net/r6jglmns/
score:0
you can set the width of the axis to be the same on both graphs
scales: {
yaxes: [
{
id: 'y-axis-1',
afterupdate: function(scale) {
scale.width = 100 // set this value to be the same on both graphs
},
},
],
}
Source: stackoverflow.com
Related Query
- Horizontally align Chart.js y axes
- Chart js. How to align text by the center of the tooltip?
- How to align Chart.JS line chart labels to the center
- ChartJS:align zeros on chart with multi axes
- Chart js: how can I align the legend and the title
- Display Date Label in axes - chart js/ng2 charts
- How to align Chart JS "legend" on right-center
- How to make a chart scroll horizontally (when using Chart.js)
- ChartJS: two axes in horizontalBar chart
- Stacked Mixed Horizontal Bar Chart in Charts.Js Axes Positioning
- Chart.js version 2.5 tooltip align items horizontally
- How do I remove cartesian axes from chart js?
- Is it able to align line chart at left margin in mixed chart?
- Connect the dot vertically instead of horizontally on Line Chart
- Chart.js two y axes line chart tooltip value incorrect for 2nd y axis
- Change axes position in line chart
- Align lines and bars in a mixed chart
- how to add second axes to chart JS
- Vertical align bar chart from chart.js not working
- what is wrong with my code ? java script chart position
- How to print a chart rendered by code
- How to align bars in bar chart - Chart.js
- VueJS + Chartjs - Chart only renders after code change
- Stacked Horizontal Bars not in align Chart JS
- Rotating a chart.js pie chart with two datapoints to align both sectors on horizontal axis
- How do I destroy/update Chart Data in this chart.js code example?
- Is it possible to dynamically add more Y Axes or more X Axes on chart js?
- getting additional value fields from data source for dx.chartjs doughnut chart
- 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
- How to align multiple x axes in chart.js?
More Query from same tag
- Chart.js - Getting data from database using mysql and php
- Chart.js : How to fill the area under the line to a certain point?
- Change the background color of tooltip dynamically using chart color
- How to remove quotations from a dictionary in python
- How can I add a label above just the last bar in a Chart.JS bar chart?
- MongoDB based data is not populating in Chart.js
- How to filter dropdown based on the choice of another dropdown in JS?
- How to display Line Chart dataset point labels with Chart.js?
- Datasets in Chart.js stacked barchart appear overlaid instead of stacked
- Chart.js formatting data values
- ChartJS - can't display all the items in the array
- Chartjs Options are ignored
- JavaScript Chart.JS - issue keeping charts in two rows, instead everything in stacked into one column
- chartjs stack bar graph color not working
- ChartJS chart is bugged after adding new data
- Charts.js tooltip overlapping text on chart
- Force display of ticks on xAxes using chartkick gem and chart.js
- How to change colors in react charts
- ChartJs pie legend position
- Creating mixed Bar Chart with ReactJS using recharts or react-chartjs-2
- HTML Input Form to a Javascript Variable
- Chart.js - shrinking legend to fit data
- chart.js : Not all points use defined colors
- How to get multiple elements on a page using flask (tables, pie charts, etc.)
- Chart.js how to remove final label on chart
- ChartJS 2.0 - Huddle labels on pie chart
- Chart.js - add gradient instead of solid color - implementing solution
- Display ellipsis for null or empty values in the bar chart using Chart.js
- Trying to export chart with Chartjs and React but getting erorr
- Is there a way to implement chart-js-plugin-waterfall as a react component