2
$\begingroup$

Ive hunted high and low for a solution. I can put inclined labels on bar charts:

BarChart[{{1, 2, 3}, {4, 5, 6}}, 
 ChartLabels -> {Placed[{"c1", "c2"}, Axis, Rotate[#, Pi/4] &]}]

, but this fails for stacks:

BarChart[{{1, 2, 3}, {4,5,6}},
 ChartLabels -> {Placed[{"a", "b"}, Axis, 
    Rotate[#, Pi/4] &]}, ChartLayout -> "Stacked"]

Where am I going wrong?

$\endgroup$

1 Answer 1

2
$\begingroup$

To associate labels with rows of data you need to use ChartLabels -> {labels, None}.

BarChart[{{1, 2, 3}, {4, 5, 6}}, 
 ChartLabels -> {Placed[{"aaa", "bbb"}, Axis, Rotate[#, Pi/4] &], None}, 
 ChartLayout -> "Stacked"]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.