score:20
Accepted answer
You have to add these parameters to your code - enable stacking for X and disable it for Y axis:
xAxes: [{ stacked: true }],
yAxes: [{
stacked: false,
ticks: {
beginAtZero: true,
},
}]
score:0
scales: {
xAxes: [{
stacked: true
}],
yAxes: [{
stacked: false,
ticks:{
suggestedMax:50,
suggestedMin:1,
beginAtZero:true,
max:100,
autoSkip:true,
lineHeight:2
}
}]
}
score:11
Nevermind, I found the answer.
options: {
scales: {
xAxes: [{ stacked: true }],
yAxes: [{
ticks: {
beginAtZero:true
},
stacked: false
}]
}
}
You just need to set the xAxes stacked to true and yAxes to false
Source: stackoverflow.com
Related Query
- chart.js stacked graph that overlaps
- How can I create a stacked bar chart with Charts.JS that displays relative rather than absolute values?
- ChartJS: Is this horizontal stacked bar and line graph multiaxis chart even possible?
- How to clear a chart from a canvas so that hover events cannot be triggered?
- Chartjs v2.0: stacked bar chart
- Horizontal stacked bar chart with chart.js
- Vertical stacked bar chart with chart.js
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Click event on stacked bar chart - ChartJs
- How to create stacked bar chart using react-chartjs-2?
- chart js tooltip how to control the data that show
- Hide empty bars in Grouped Stacked Bar Chart - chart.js
- How to display inline values in a stacked bar chart with Chart.js?
- Creating a grouped and stacked chart in Chart.js
- Showing Percentage and Total In stacked Bar Chart of chart.js
- How to use 'time' (data from database, data type: timestamp ) for plotting graph in Chart JS
- Stacked horizontal bar chart along total count with chart.js
- Stacked bar chart results in misaligned bars
- Multiple stacked bar chart using ChartJs
- Chart.js: Minimum value for x-axis at horizontal stacked bar chart
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- Create multiple dynamic stacked chart using chart.js in Angular 10?
- Add a custom label to the top or bottom of a stacked bar chart
- ChartJs - Pie Chart - how to remove labels that are on the pie chart
- Stacked bar chart starting from 0 - ChartJS React
- Chartjs (Non Vue) Not Rendering Graph Chart inside V-if/V-show
- In Stacked horizontal bar chart how to remove the vertical line in Chart.js?
- How to remove border from stacked column chart in Chartkick - Chart.js
- Click event of stacked line chart not working
- Stacked bar chart with rounded corner of bar using Chart.js
More Query from same tag
- How to create multiple y-axis time series chart
- How to change chart.js grid, and axis color?
- Change font family of labels in piechart and linechart in chartjs
- custom label x-axis in chart.js
- ChartJS: Highlight dataset in a stacked bar chart when hovering over the legend?
- Polar Area Chart
- how to insert dynamic data from sql into chartjs stacked bar chart javascript
- How to implement dynamic data on chartjs?
- Cannot read property 'length' of undefined for ChartJS when I use it inside React
- Chartjs Doughnut disappears
- How to draw lines between minimum and maximum value to average value in chartJS?
- How to inject data into chartjs plugin function?
- ChartJS Bar chart painting second bar to the right
- Chart.js horizontal line chart or modified horizontal bar chart
- Can I make a horizontal bar chart with two category axes?
- Error passing custom options to radarChartJS
- Grouped bar charts with intersecting ticks
- Displaying line chart for multiple months using chart.js
- Change chart values from API
- Chart.JS, date issues when upgrading to v3
- ChartDataLabels is globally active for some reason
- Chart.js dynamically upating data using variable
- Chart Js reduce text size for label on X axis
- Always Enable Tooltip : Chart JS : V3 : Bubble Chart : react-chartjs-2
- How to Display Chart.js line-chart from a MVC Controller
- $scope.chart undefined in angular-chart
- How to display a barchart in chart.js?
- Why doesn't Chart.js display my output (result of a const function)?
- Chart.js coming up as blank
- Get Date Range with Given Date