score:1
Accepted answer
In order to get an effect that looks like in your provided sample image you could use a stacked bar charts with three datasets. Have a look at the code snipped to see what I mean.
var bar_ctx = document.getElementById('bar-chart').getContext('2d');
var bar_chart = new Chart(bar_ctx, {
type: 'bar',
data: {
labels: ["1", "2", "3", "4", "5", "6"],
datasets: [{
label: 'test0',
data: [3, 4, 7, 3, 6, 2],
backgroundColor: 'deepskyblue',
}, {
label: 'test1',
data: [2, 9, 3, 3, 4, 8],
backgroundColor: 'skyblue'
},
{
label: 'test2',
data: [2, 9, 3, 3, 4, 8],
backgroundColor: 'powderblue'
}
]
},
options: {
legend: {
display: false
},
scales: {
yAxes: [{
stacked: true,
ticks: {
beginAtZero: true
}
}],
xAxes: [{
stacked: true,
}]
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.bundle.min.js"></script>
<canvas id="bar-chart"></canvas>
Source: stackoverflow.com
Related Query
- Gradient color for each bar in a bar graph using ChartJS
- Different color for each bar in a bar graph in ChartJS and VueJS
- Different color for each bar in a bar chart; ChartJS
- How to set a full length background color for each bar in chartjs bar
- How to use set the color for each bar in a bar chart using chartjs?
- Issue with chartjs linear gradient for the mixed bar chart in ReactJS is not calculated for each individual Bars
- Set different color for each bars using ChartJS in Angular 4
- subcategories for each bar in multibar chart using chartjs
- Angular 4: Different color for bar in bar chart dynamically using ChartJS
- how to create bar chart with group and sam color for each group using chart.js?
- Different color for each column in angular-chartjs bar chart
- How to make customized stepSize for each horizontal bar in Chart.js graph
- how to set color for each item in tooltip with ChartJS
- chartjs stack bar graph color not working
- How to add additional label in the middle of each bar using ChartJS
- The dataset for bar graph is not set properly using ng2 charts and ng5-slider in Angular
- Chartjs random colors for each part of pie chart with data dynamically from database
- Change point color on click using ChartJS
- ChartJS bar chart with legend which corresponds to each bar
- Border radius for the bar chart in ChartJS
- Chartjs - data format for bar chart with multi-level x-axes
- Chartjs - show elements in all datasets on hover using bar chart
- ChartJS bar not showing up for simple data points
- Create a rounded bar graph with Angular and chartJS
- Grouping the object by key for Chartjs bar chart
- chart js - Apply different color for each x-axes label
- Chartjs - pointColor to follow current color of gradient stroke
- X-axis multiple colored label for bar chart using chart.js
- Different color for line segments in ChartJS
- Multiple stacked bar chart using ChartJs
More Query from same tag
- How to add variable-pie chart to react project?
- Chartjs line graph point hover animation buggy / jumpy
- Chart.JS - show values on top of points
- How to add label square to Bar Chart using Chart.js
- Angular charts is not displayed
- Is it possible to make chartjs charts scrollable?
- Chart options in angularJs (NodeRed Charts)
- ChartJS linechart edit yAxis labels
- How to group and count missing values using linq
- How to shorten Chart.js label
- How do I put this on Real-Time? I already put (async: True) but it doesnt work
- refs in reactjs Component empty
- Chartjs doughnut segment pattern
- Chart.js in flex element overflows instead of shrinking
- Can you draw a graph without rendering it?
- JavaScript Error - Uncaught SyntaxError: Unexpected number
- how to make doughnut chart portions, buttons
- Single Stacked bar with three sections in Angular
- ChartJS - handling of overlapping points in line chart
- Chart.js v2.0: Tooltip only for one dataset
- How to stop resizing chart.js in case hovered and out of boundaries?
- Script won't run from ejs file in nodejs application
- Dynamically changing chartjs tick colours
- ChartJS pie chart with simple parsing options doesn't render, only works when set as bar/line chart
- How to display data values on Chart.js
- How to collect values of object properties into a list?
- Reopening a "ChartJS" chart in a new window (VS, C#, ChartJS)
- Rotate chart "pie" to need value or angle
- Chart.js : How to get a line created by sum of others line?
- Sum array of objects value based on month - ReactJS