# How can I close a gap in a bar chart?

I have the bar chart below:

My code:

BarChart[{Labeled[{a760, c760, b760, d760}, "760" ],
Labeled[{a780, c780, b780, d780}, "780" ]},
ChartStyle -> {Blue, Red, Green, Black},
ChartLegends ->
Placed[{"65.5 ps", "274 ps", "16.8 ps", "2040 ps" }, {Right}],
BarSpacing -> {0, 1}]


The third entry of 780 is missing, so I used Missing[]. I want to attach the forth entry

of 780 to the second entry of 780. The point is that the color of the forth entry must

remain black because each color indicates a quality such as lifetimes.

-
When you say "attach" do you mean "stack"? That is, to put the black bar on top of the red bar? Or below? Or what does attach mean in this case? –  Pickett Mar 26 at 13:45
I mean put the dark one alongside of the red one. I want them side to side. –  yashar Mar 26 at 15:31
Please include the data, if possible so we can reproduce your graph and inspect it. –  David Carraher Mar 26 at 16:52

I can't think of any clever way to remove the gap, so here is a way to get the chart using Style to specify individual colours for the bars:

data1 = {10, 5, 20, 2};
data2 = {12, 8, Missing[], 3};

colors = {Blue, Red, Green, Black};

applycolors = Style @@@ DeleteCases[Thread @ {#, colors}, {Missing[], _}] &;

BarChart[{
Labeled[applycolors @ data1, "760"],
Labeled[applycolors @ data2, "780"]},
BarSpacing -> {0, 1}] ~Legended~
SwatchLegend[colors, {"65.5 ps", "274 ps", "16.8 ps", "2040 ps"}]


-
Thank you. Your answer is exactly what I needed. –  yashar Mar 27 at 0:44