I am using chart.js to make bar chart with two bars. I need different colors for them. But when I have two datasets, I have different colors which I want, but bars are grouped in one label like this: screenshot and code:
var barChartData = {
labels : ["Pronájem","Trvalá licence"],
datasets : [
{
fillColor : "rgba(0,59,98,0.5)",
strokeColor : "rgba(0,59,98,0.8)",
highlightFill: "rgba(0,59,98,0.75)",
highlightStroke: "rgba(0,59,98,1)",
data : [30000]
},
{
fillColor : "rgba(179,178,178,0.5)",
strokeColor : "rgba(179,178,178,0.8)",
highlightFill : "rgba(179,178,178,0.75)",
highlightStroke : "rgba(179,178,178,1)",
data : [80000]
}
]
}
window.onload = function(){
var ctx = document.getElementById("canvas").getContext("2d");
window.myBar = new Chart(ctx).Bar(barChartData, {
responsive : false
});
}
When I have one dataset with two data entries, each bar have its own label, but they have same color.
I need it to look like this: screenshot
Any advice?