2
$\begingroup$

I'm trying to create a bar chart that displays job evaluation ratings visually. Rather than use a bar, I'd like to show each rating number as a discrete unit, a rounded rectangle. As per Mathematica help files, you can use any Graphic as a Chart Element, good. But even in their examples, the partially rendered objects are not accurate.

data = {Tooltip[7, "testing"], 7.7, 5, 9, 3.3};
BarChart[
 data,
 PlotLabel -> "Name",
 BarOrigin -> Left,
 Ticks -> None,
 BarSpacing -> 0,
 LabelingFunction -> After,
 ChartElements -> Graphics[{
    LightBlue,
    Rectangle[RoundingRadius -> .3]
   }],
 ChartLabels -> {"Communication", "Collaboration", "Timeliness", 
   "Prof. Dev.", "Habits of Mind"}
 ]

Resulting bar chart

It does seem to work with Graphic3D objects like spheres, but only if the Viewpoint is not adjusted.

Using Graphic3D Spheres works better, but not the look I'm going for

I have looked into Scaling Functions for the graphics with little success. Any way to get the look of the first with the accuracy of the second?

$\endgroup$
3
$\begingroup$

Use ChartElements -> {Graphics[{LightBlue, Rectangle[RoundingRadius -> .3]}], {1, 1}}:

BarChart[data, PlotLabel -> "Name", BarOrigin -> Left, Ticks -> None, 
 BarSpacing -> 0, LabelingFunction -> After, 
 ChartElements -> {Graphics[{LightBlue, Rectangle[RoundingRadius -> .3]}], {1, 1}}, 
 ChartLabels -> {"Communication", "Collaboration", "Timeliness", 
   "Prof. Dev.", "Habits of Mind"}]

enter image description here

ChartElements >> Details:

enter image description here

Multicolumn[
 Table[Labeled[
   BarChart[data, PlotLabel -> "Name", BarOrigin -> Left, 
    Ticks -> None, BarSpacing -> 0, LabelingFunction -> After, 
    ChartElements -> {Graphics[{LightBlue, 
        Rectangle[RoundingRadius -> .3]}], wh}, 
    ChartLabels -> {"Communication", "Collaboration", "Timeliness", 
      "Prof. Dev.", "Habits of Mind"}, ImageSize -> 300], wh, Top], 
    {wh, {{1, 1}, {1, All}, {All, 1}, All, {1, 1/2}, {1/2, 1}}}], 
  2, Appearance -> "Horizontal"]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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