Reverse-order Negative BarSpacing

Suppose I have some data for a bar chart:

testdata = Map[{1, #} &, RandomReal[{-0.5, 4}, {3, 2}], {2}]
(* {{{1, 3.30023}, {1, 3.814}}, {{1, -0.353959}, {1, -0.364447}}, {{1,
1.82514}, {1, 2.56824}}} *)

RectangleChart[testdata, BarOrigin -> Left, Frame -> True,
ChartStyle -> {Red, Blue}, BarSpacing -> {-0.2, 0.6}]


But what I really want is for the shorter, red bars to overlap on top of the blue bars, not underneath.

RectangleChart[Reverse /@ testdata, BarOrigin -> Left, Frame -> True,
ChartStyle -> {Blue, Red}, BarSpacing -> {-0.2, 0.6}]


That works, but the red bars only overlap if they are above the blue bars. If I had set BarOrigin->Bottom, the red bars would then be on the right.

RectangleChart[Reverse /@ testdata, Frame -> True,
ChartStyle -> {Blue, Red}, BarSpacing -> {-0.2, 0.6}]


Conceptually this is because later data prints after earlier data, so groups of bars on the right or at the top are "later" and print on top of the "earlier" bars on the left or below.

This makes sense to me, but not to the person I am drawing the graph for. Is there any way to reverse the bar ordering such that the bars at the bottom of the group overlap on top of the upper bars when one has negative BarSpacing?

-
Does this work MapAt[Rotate[#, -90 Degree] &, RectangleChart[testdata, Frame -> True, ChartStyle -> {Blue, Red}, BarSpacing -> {-0.2, 0.6}, Axes -> False, BarOrigin -> Bottom], {1}] (with some extra work on tick labels)? – kglr Jun 2 '14 at 5:27
@kguler - It would need to be RectangleChart[Reverse/@testdata.... That is inspired, but how I'd then get that into our crazy custom charting functions is a challenge. – Verbeia Jun 2 '14 at 7:07

I like kugler approach, this is another one. Not sure if it is going to work for general case but it should.

RectangleChart[testdata, BarOrigin -> Left, Frame -> True, ChartStyle -> {Red, Blue},
BarSpacing -> {-0.2, 0.6}
] /. x : {{__, _Tooltip} ..} :> Reverse@x


Of course for PerformanceGoal:>"Speed" there are no Tooltips but it is easy to handle too.

RectangleChart[testdata, BarOrigin -> Left, Frame -> True, ChartStyle -> {Red, Blue},
BarSpacing -> {-0.2, 0.6}, PerformanceGoal :> "Speed"
] /. x : {{__, _Rectangle} ..} :> Reverse@x

-
Ah, clever, kubanator! +1 – ciao Jun 2 '14 at 7:39
@rasher Hehe :) thanks. – Kuba Jun 2 '14 at 7:41
This is excellent! I'm just testing if it works with our crazy custom functions. – Verbeia Jun 2 '14 at 7:52
@Verbeia I'm glad I could help :) – Kuba Jun 2 '14 at 17:31