Strange Behavior in Barchart LabelingFunction

Bug introduced in 10.0.0 and fixed in 10.0.1

BarChart formatting algorithm make me loose some time today in V10. Now, LabelingFunction does not work beyond some number of Labels. See example:

RandomSeed[1]
barchart[n_]:=
BarChart[RandomInteger[10,{n,3}]
,LabelingFunction->(Placed[#1,Center]&)
,AspectRatio->0.2,ImageSize->700
,ChartLayout->"Percentile"
]

barchart[33]
barchart[34]


After 33, labels disappear!

Which magic parameter can I change to get my labels back? The problem is the same in V10.0.0 for Mac and Win.

I wrote to support. If I get some clue I'll post here.

The maximum number of labeled bars in Version 10.0.0 seems to be limited to 99 when LabelingFunction is used. An alternative work-around is to wrap data with Labeled:

RandomSeed[1]
barchart2[n_,m_]:=  Module[{dt=RandomInteger[10,{n,m}]},
BarChart[Labeled[#,#,Center]&/@#&/@dt,
AspectRatio->0.2,ImageSize->700,
ChartLayout->"Percentile" ]]

barchart2[34,3]


barchart2[50, 5]


• After a native option to change this behavior, I think this is a good option. +1 – Murta Jul 19 '14 at 11:49
• Please reconsider deleting this. This is an effective workaround for pre-v10.0.1. – rcollyer Sep 17 '14 at 13:44
• @rcollyer, thank you for the vote. just rolled back the delete. – kglr Sep 17 '14 at 14:15

A workaround is just to use multiple bar charts for the data

RandomSeed[1];
Clear[barchart];
barchart[n_, partitions_: 1] := Module[
{m = Ceiling[n/partitions]},
BarChart[
#,
LabelingFunction -> (Placed[#1, Center] &),
AspectRatio -> 0.2,
ImageSize -> 700,
ChartLayout -> "Percentile"] & /@
Partition[
Join[
RandomInteger[10, {n, 3}],
Table["", {m - 1}]],
m] //
Column]

barchart[33]


barchart[51, 2]


The behavior was corrected in Mathematica 10.0.1.

Using the same example:

    RandomSeed[1]
barchart[n_]:=
BarChart[RandomInteger[10,{n,3}]
,LabelingFunction->(Placed[#1,Center]&)
,AspectRatio->0.2,ImageSize->700
,ChartLayout->"Percentile"
]

barchart[33]
barchart[100]


We now have:

My tks to Wolfram team!

• Note: with ChartLayout -> "Stacked" and "Percentile" labels are not labeled. – rcollyer Sep 17 '14 at 13:44
• Thanks for posting this notification. – Mr.Wizard Sep 17 '14 at 14:20
• @rcollyer Stacked and Percentile worked nice to me in V10.0.1. – Murta Sep 17 '14 at 20:02
• They'll work, but the zero height bars aren't labeled. Just a warning. – rcollyer Sep 17 '14 at 20:54