3
$\begingroup$

I want to save some bullet gauges in PDF, as a dashboard, but what I obtain in the PDF has the numbers erased, and the Titles/Numbers erased as you can see here enter image description here

when What Mathematica10 show is

enter image description here

Note that Mathematica save PDF well, as is showed if you don´t rotate the gauges.

enter image description here

The code is

DataFile = {{"Man", "First", 215, 230, 120, 80, 65}, {"Man", "Second",
    240, 450, 180, 150, 114}, {"Woman", "First", 275, 450, 210, 190, 
   43}, {"Woman", "Second", 275, 275, 145, 134, 96}, {"Woman", 
   "Third", 200, 240, 20, 18, 12}}

NumeroPropiedades = Length[DataFile];
lonxitude = 
  Table[StringLength[DataFile[[i, 1]]], {i, 1, NumeroPropiedades}];
Max[lonxitude];

MaximoEscala = Max[Table[DataFile[[i, 4]], {i, 1, NumeroPropiedades}]];

rotate[gauge_] := 
 Rotate[gauge /. Text[l_, r__] :> Text[Rotate[l, 270 Degree], r], 
  90 Degree]
(* copied from http://ow.ly/zdSc302jZEm *)

BulletTOTAL = 
  Table[BulletGauge[{DataFile[[i, 5]], 
     DataFile[[i, 4]]*0.75}, {DataFile[[i, 3]]}, {0, DataFile[[i, 4]],
      DataFile[[i, 6]], DataFile[[i, 7]], MaximoEscala}, 
    ImageSize -> Large, 
    GaugeLabels -> 
     Placed[Style[Rotate[DataFile[[i, 1]], 3 Pi/2], "Subsection", 
       Black], Right]], {i, 1, NumeroPropiedades}];
Labeled[Row[rotate /@
   BulletTOTAL
  , Spacer[20]], 
 Row[{Style["Monthly", 39, "Subtitle", Darker[Red]]}, Spacer[30]], Top]

================== SOLUTION ======================== **

As Karsten7 said, in a comment It was a bug that was fixed between version 10.0 and 10.4.1

**

$\endgroup$
8
  • $\begingroup$ I can't reproduce such a behavior. How to you perform the export? What operating system and Mathematica version are you using? $\endgroup$
    – Karsten7
    Jul 17, 2016 at 11:44
  • $\begingroup$ @Karsten7. Win 8 and Mathematica 10.0. Then a Select the bracket in the rigth that contain the outbut of Bullets. $\endgroup$
    – Mika Ike
    Jul 17, 2016 at 11:47
  • $\begingroup$ Did you try using Export instead? $\endgroup$
    – Karsten7
    Jul 17, 2016 at 12:31
  • $\begingroup$ @karsten-7 Yes I just tried, and the same result... as the first image posted, without Titles/labels and whithout numberlabels.. $\endgroup$
    – Mika Ike
    Jul 17, 2016 at 13:07
  • 2
    $\begingroup$ I'm using Mathematica 10.4.1 on Windows 10. It's probably a bug that has been fixed. PDF screen shot $\endgroup$
    – Karsten7
    Jul 17, 2016 at 13:36

1 Answer 1

1
$\begingroup$

You can try using a direction vector for Text instead of using Rotate to rotate the labels, as demonstrated in this answer:

DataFile = {{"Man", "First", 215, 230, 120, 80, 65}, {"Man", "Second",
     240, 450, 180, 150, 114}, {"Woman", "First", 275, 450, 210, 190, 
    43}, {"Woman", "Second", 275, 275, 145, 134, 96}, {"Woman", 
    "Third", 200, 240, 20, 18, 12}};

NumeroPropiedades = Length[DataFile];
lonxitude = Table[StringLength[DataFile[[i, 1]]], {i, 1, NumeroPropiedades}];

MaximoEscala = 
  Max[Table[DataFile[[i, 4]], {i, 1, NumeroPropiedades}]];

rotate[gauge_] := 
 Rotate[gauge /. 
   Text[value_, Offset[o_, s_], d1_, {1, 0}] :> 
    Text[value, Offset[{0.5, -12.}, s], {0., 0.}, {0, -1}], 90 Degree]

BulletTOTAL = 
  Table[BulletGauge[{DataFile[[i, 5]], 
     DataFile[[i, 4]]*0.75}, {DataFile[[i, 3]]}, {0, DataFile[[i, 4]],
      DataFile[[i, 6]], DataFile[[i, 7]], MaximoEscala}, 
    ImageSize -> Large, 
    GaugeLabels -> 
     Placed[Graphics@
       Text[Column[{Style[DataFile[[i, 2]], 18], 
          Style[DataFile[[i, 1]], 25, Bold]}, Center], {0, 0}, 
        Automatic, {0, -1}], {1, 2/3}]], {i, 1, NumeroPropiedades}];
Labeled[Row[rotate /@ BulletTOTAL, Spacer[20]], 
 Row[{Style["Monthly", 39, "Subtitle", Darker[Red]]}, 
  Spacer[30]], Top]

Alternatively one can use VerticalGauge to produce fake vertical BulletGauges.

BulletTOTAL = Table[
   Show[{
     VerticalGauge[0, {0, MaximoEscala}, ScaleDivisions -> {5, 1}, 
      ScaleRanges -> ({#, {0, 0.2}} & /@ 
         Partition[
          Sort@{0, DataFile[[i, 4]], DataFile[[i, 6]], 
            DataFile[[i, 7]], MaximoEscala}, 2, 1]), 
      ScaleRangeStyle -> {GrayLevel[0.6], GrayLevel[0.7], 
        GrayLevel[0.8], GrayLevel[0.9]}, GaugeMarkers -> None, 
      ImageSize -> Large],
     VerticalGauge[{DataFile[[i, 3]]}, {0, MaximoEscala}, 
      ScaleDivisions -> {5, 1},
      ScaleRanges -> ({#, {0.06, 0.14}} & /@ 
         Partition[Sort@{0, DataFile[[i, 5]], DataFile[[i, 4]]*0.75}, 
          2, 1]), ScaleRangeStyle -> 
       Reverse[ColorData[63, "ColorList"][[;; 2]]], 
      GaugeMarkers -> 
       Graphics[{GrayLevel[0.1], Opacity[0.5], Thickness[0.07], 
         Line[{{0, 0}, {3 + 1/3, 0}}]}], 
      GaugeLabels -> 
       Placed[Column[{Style[DataFile[[i, 2]], 18], 
          Style[DataFile[[i, 1]], 25, Bold]}, Center], {0.16, 0.97}], 
      ImageSize -> Large]
     }, AspectRatio -> 7
    ], {i, 1, NumeroPropiedades}];

Labeled[Row[BulletTOTAL, Spacer[20]], 
 Row[{Style["Monthly", 39, "Subtitle", Darker[Red]]}, 
  Spacer[30]], Top]

Fake

$\endgroup$

Your Answer

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

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