4
$\begingroup$

Bug introduced in 11.3. Fixed in 13.2.0 or earlier.


Need a workaround so I can plot a tool tip that provides the bar height and in the same tool tip also gives the parts of the dataset that created the bar in BarChart3D. I have tried LabelingFunction -> TooltipLabel, but today it only works on small datasets, but when the data is larger (1600+ plotted points) it fails to work. This is a bug in 11.3 confirmed by MMA support. So I'm wondering if the geniuses here on MMSE can provide a good solution until this gets fixed in the code.

dataLabels = Partition[Round@RandomReal[{0, 100}, {20, 4}], 4];

barheight = Partition[Flatten@RandomReal[{0, 1}, 20], 4];

TooltipLabel[value_, {row_, column_}, {{rowLabel_}, {columnLabel_}}] :=
   Placed[Row[{value, ", ", {dataLabels[[row, column]]}}], 
   Tooltip];

plot = BarChart3D[barheight, ChartLayout -> "Grid", ImageSize -> 200, 
           BoxRatios -> {7, 7, 5}, 
          Method -> {"Canvas" -> None}, Boxed -> False, 
          Ticks -> {None, None, Automatic}, ViewPoint -> {0, -1.5, 1.5}, 
          BarSpacing -> None, 
              Background -> White, Lighting -> "Neutral", Axes -> False, 
          LabelingFunction -> TooltipLabel]

The code above works on small charts like this example but at some point the tooltip disappears as the plots get larger. I need a solution that works on a 2k size data set. Thanks in advance for your help!

$\endgroup$

1 Answer 1

2
$\begingroup$

Increasing the points to the number suggested by the OP

dataLabels = Partition[Round@RandomReal[{0, 3000}, {20, 4}], 4];
barheight = Partition[Flatten@RandomReal[{0, 5}, 20], 4];
TooltipLabel[value_, {row_, column_}, {{rowLabel_}, {columnLabel_}}] :=
   Placed[Row[{value, ", ", {dataLabels[[row, column]]}}], Tooltip];
plot = BarChart3D[barheight, ChartLayout -> "Grid", ImageSize -> 200, 
  BoxRatios -> {7, 7, 5}, Method -> {"Canvas" -> None}, 
  Boxed -> False, Ticks -> {None, None, Automatic}, 
  ViewPoint -> {0, -1.5, 1.5}, BarSpacing -> None, 
  Background -> White, Lighting -> "Neutral", Axes -> False, 
  LabelingFunction -> TooltipLabel]

gives

Blockquote

$\endgroup$

Your Answer

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

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