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 skip labels on x-axes?
- Chart.js core.js:6162 ERROR Error: "line" is not a registered controller
- Showing a duration of time within a Chart.js chart
- How to use below syntax in chart.js 3.x?
- Group Bar Chart Dinamic Data Update By Button Fuction ChartJS
- How to convert Data table to Json in Javascript
- How to set start value as “0” in Chart.js Laravel
- Removing exceeding parts of axis
- chart.js radar scaleShowLine for each scaleLine
- code works fine on jsfiddle but one function is not working on website
- Add data to line chart using chart.js
- How to show xaxis lable o only data point and hide all others?
- How can I hide tick marks on Chart.js?
- ChartJS showing wrong dataset following visibility property toggle
- Chart JS - Is there a way to connect two datasets in a line chart?
- ChartJs bar chart bar value displaying lower then Y axis value in pdf?
- How to show bar chart labels clearly using ChartJS?
- Chart.js V2 ticklines no grid
- Line chart doesn't work with type time chart.js
- ChatJS 2.8 chaning x-Axis font style and color
- ChartJS Adding Different Lines for each column
- Getting rid of Chart.js canvas subpixels
- How to use segment property to color line / border color based on value in chart js?
- Show gridlines over graph in chart.js, show bold x-axis label in chart.js, mixure of intersecting graph colors in chart.js
- Chart.js - is there a way to extend an existing scale?
- Chart.js not showing when i try to format dates
- Time Series Line chart js in react not working
- Problem adding name to X-axis for a chart
- Chart.js remove gridline
- Django integration with Charts.js, I'm unable to find the syntax for passing the data to the template