By default the Axis
position that you're using centers the label under the bar along the axis. For long text that's rotated at a slant, it generally looks bad. (It works fine for horizontal and vertical text, however.)
Here's one approach, using a different second argument for Placed
:
Module[{
labels = {"Learning focused", "Positively oriented", "Continuous",
"Timely", "Clear criteria", "Flexible", "Suited to student level"},
data = {8, 6, 4, 5, 5, 9, 9}
},
BarChart[data,
ChartLabels -> Placed[
labels,
{{0.5, 0}, {0.9, 1}},
Rotate[#, (2/7) Pi] &
],
PlotRange -> {Automatic, {0, 10}}, Ticks -> {None, Range[0, 10, 2]},
ImagePadding -> {{20, 0}, {95, 0}}
]
]
The first part of the argument, {0.5, 0}
, says to place the label halfway across the bar, at the bottom.
The second part of the argument, {0.9, 1}
, says what part of the label at the first part. In this case it's near, but not quite at, the right-top corner.
It's not exactly at the corner, because I think it looks better if the top of the "ink" is centered below the bars, and that won't be the actual corner unless your label ends with ">" or something similar.
Here's a second approach, using a different third argument of Placed
:
Module[{
labels = {"Learning focused", "Positively oriented", "Continuous",
"Timely", "Clear criteria", "Flexible", "Suited to student level"},
data = {8, 6, 4, 5, 5, 9, 9}
},
BarChart[data,
ChartLabels -> Placed[
labels,
Axis,
Block[{text = Rotate[#, (2/7) Pi]},
Row[{text, Invisible[text]},
"\[NegativeMediumSpace]"]
]&
],
PlotRange -> {Automatic, {0, 10}}, Ticks -> {None, Range[0, 10, 2]},
ImagePadding -> {{20, 0}, {95, 0}}
]
]
This uses the normal axes positioning, but for each label, it creates an object that has the label and an invisible copy of the label side-by-side so that the center of the object is the end of the visible label. (I used a negative space between the objects, because again I think it looks better.) The nice thing about this approach is that the basic idea can be used for labels for ticks on axes that don't otherwise allow specific placements.
AdjustmentBox
in yourPlaced
function. I haven't time to write this up as a full answer just now but someone else might like to try. $\endgroup$