score:0

Accepted answer

1) set 2 labels for each sub category within a category 2) for each bar within a category, add the value if it matches the label position, then add 0 to the value for the alternative sub category not matching the label position

this will produce a bar chart where each category only has 1 bar of a colour gradient unique to that subcategory.

you may need to play around with the bar sizing, since i only have 2 sub categories, i set

scales: {
        xaxes: [{
            barpercentage: 8,
            categorypercentage: 0.1
        }]
    }
}

and it aligned with the category label closely enough for me.


Related Query

More Query from same tag