# How to create a vertical bullet gauge?

Originally posted in MathematicaMeta SE, titled "I can't understand why Mathematica has an excellent (perhaps the best!) BulletGauge command (with multiple options)", as a reflexion about the inconsistence of Mathematica has the best (comparing with other software) Bulletguage command BUT ONLY in HORIZONTAL!! without an option to make it VERTICAL nativelly

I can't understand why Mathematica has an excellent (perhaps the best!) BulletGauge command (with multiple options)

BUT.... only in horizontal!!!

AND it´s not available in Vertical!!

There is an SE-Solution (Stack Exchange Solution):

but

It's really a pity and I can't understand why is not available an option to do it in vertical.

Best regards. I don't know if this site is for this kind of opinions.

• If you rephrase it too e.g. "how to create a vertical gauge? I was only able to find a horizontal one" then it will fit here well. – Kuba Jan 7 '18 at 9:46
• I changed the question title as per Kuba's suggestion so that the question will be easier to find in the future, e.g. when searching on Google. – C. E. Jan 7 '18 at 11:34

## "GaugeOrigin"

Update: it turns out that there is an undocumented option "GaugeOrigin" that controls the orientation of the gauge.

BulletGauge[{42, 82}, {40, 68, 97}, {0, 100}, "GaugeOrigin" -> #, ImageSize ->Medium] & /@
{Bottom, Top, Left, Right} // Row[#, Spacer[10]] &


In version 9, this produces the error message

OptionValue::nodef: Unknown option "GaugeOrigin" for BulletGauge

but gives the correct result. So you can suppress the error message using Quiet or use it a suboption of the option Method, i.e., Method -> {"GaugeOrigin" -> Bottom} works without complaint.

Update 2: The option "TickLength" controls the tick lengths:

BulletGauge[{42, 82}, {40, 68, 97}, {0, 100},
"GaugeOrigin" -> #, "TickLength" -> Scaled[.3], ImageSize -> Medium] & /@
{Bottom,  Top, Left, Right} // Row[#, Spacer[10]] &


You can post-process a BulletGauge to make it vertical:

bg = BulletGauge[{42, 82}, {40, 68, 97}, {0, 100}]


makeVertical = Graphics[GeometricTransformation[#[[1]], RotationTransform[Pi/2]] /.
Text[a___, Offset[o_, p_], off_, dir_] :>
Text[a, Offset[{0, -20}, p], {1, 0}, -Reverse @ dir]] &;

makeVertical @ bg


• thank you very much. One question and one reflexion. The question How to control the sixe of segments between graph and Numbers?. imgur.com/a/G4Wji The reflexion: People with your Mathemtica knowledge or similar can do that kind of things, but I couln´t do it. So I can´t understand why Mathematica can´t offer that feature in a simple way. The purpose of a software should be make easier assignments/works and not offer a close-up solution that need a sophisticated procedure to can apply it. – Mika Ike Jan 7 '18 at 10:41
• If I can make a HORIZONTAL bullet gauge in a minute. Logically, I would can make a VERTICAL bullet gauge in the same time, if the software it´s designed with a minimal logic. Without your help or other, I need months to reach the solution to make a VERTICAL bullet gauge, when I can do an HORIZONTAL bullet in less than 1 minute. It´s that what I can´t underestand in the design of Mathematica. – Mika Ike Jan 7 '18 at 10:45
• @MikaIke, Thank you for the accept. I too am surprised that such a natural feature is not available out of the box. I will post an update with the parameters that control the tick lengths. – kglr Jan 7 '18 at 10:57
• @MikaIke, the option "GaugeOrigin" appears in Options[ChartingiLinearGauge] where ChartingiLinearGauge is one of the functions called by BulletGauge. – kglr Jan 7 '18 at 20:17
• @MikaIke, re (Q1) for some functions you can see the code using Needs["GeneralUtilities"] followed by PrintDefinitions[BulletGauge]. There you see the call to ChartingiLinearGauge. (Q2) Based on BarOrigin for Histogram/BarChart it was a lucky guess that Left/Right/Top/Bottom might work:) (Q3) Red highlight indicates syntax error which i guess is related to the fact that this usage pattern is undocumented and syntax highlighting subsystem treats it as error. – kglr Jan 8 '18 at 7:22

I think using Rotate is pretty "out of the box" solution (although the tick labels are not rotated.)

bg = BulletGauge[{42, 82}, {40, 68, 97}, {0, 100}];
Rotate[bg, Pi/2]