# Can I change the font of all elements in my barchart with one property?

I have this BarChart:

created with this code:

sizes = {10718, 881, 395, 387, 375, 309, 297};
BarChart[sizes, ChartStyle -> 33, ImageSize -> 480, BarOrigin -> Left, ChartLabels ->
Placed[sizes, {{1, 0.25}, {0, 0}}, "  " <> ToString[#] <> " kB" &],
ChartLegends -> {"DelphiXE3", "Delphi2010", "Delphi2005", "Delphi7",
"Delphi6", "Delphi5", "Delphi4"}]


Now I want all of the text: ChartLabels, ChartLegends and tick labels in Helvetica. Can I do this with a single property, or do I have to add the property for each of the three elements separately? And how do I either?

-
BaseStyle -> Directive[FontFamily -> "Helvetica"]. This probably should be merged with your previous question. –  Mike Honeychurch Jul 14 '14 at 9:23
@MikeHoneychurch - Thanks again. Not sure about merging; the data is the same, but here it's about the font globally, which wasn't in the other question. –  stevenvh Jul 14 '14 at 9:27
@MikeHoneychurch - This doesn't seem to change the font for the legends. –  stevenvh Jul 14 '14 at 9:29
ok. see answer below –  Mike Honeychurch Jul 14 '14 at 9:35

On its own LabelStyle works for me so long as rules are given as a List, not a Directive.

Minimal example:

BarChart[{1, 2, 3},
ChartLegends -> {"one", "two", "three"},
LabelStyle -> {FontSize -> 15, FontFamily -> "Trajan Pro"}
]


sizes = {10718, 881, 395, 387, 375, 309, 297};

BarChart[sizes,
ChartStyle -> 33,
ImageSize -> 480,
BarOrigin -> Left,
ChartLabels -> Placed[sizes, {{1, 0.25}, {0, 0}}, "  " <> ToString[#] <> " kB" &],
ChartLegends -> {"DelphiXE3", "Delphi2010", "Delphi2005", "Delphi7", "Delphi6",
"Delphi5", "Delphi4"},
LabelStyle -> {FontSize -> 15, FontFamily -> "Trajan Pro"}
]


Trajan Pro is a distinctive small-caps font I happen to have installed. Substitute Helvetica for deployment.

-
Trajan? You'll annoy the internets... :) –  cormullion Jul 14 '14 at 10:57
@cormullion My only defense is that I was using it before it was overused (I think). Here it merely serves as a distinctive font I have available. I used Comic Sans for that purpose until I saw torches and pitchforks. :o) Got another suggestion for a distinctive font selection, preferably freeware? –  Mr.Wizard Jul 14 '14 at 11:00
Just pick one from here - lots to choose from... :) –  cormullion Jul 14 '14 at 11:08
Failure of Directive would be a bug –  Mike Honeychurch Jul 14 '14 at 20:17
@MikeHoneychurch I suppose so. No upvote? Isn't at least "This answer is useful?" –  Mr.Wizard Jul 14 '14 at 23:47
sizes = {10718, 881, 395, 387, 375, 309, 297};
font = "Helvetica";
BarChart[sizes, BaseStyle -> Directive[FontFamily -> font],
ChartStyle -> 33, ImageSize -> 480, BarOrigin -> Left,
ChartLabels ->
Placed[sizes, {{1, 0.25}, {0, 0}}, "  " <> ToString[#] <> " kB" &],
ChartLegends ->
Placed[{"DelphiXE3", "Delphi2010", "Delphi2005", "Delphi7",
"Delphi6", "Delphi5", "Delphi4"}, Right,
Style[#, FontFamily -> font] &]]


-
Thanks a bunch. I presume the "14" is supposed to change the font size, but it doesn't do anything, not even when I add "FontSize->" in front of it. This did work for the BaseStyle solution you suggested in comment. –  stevenvh Jul 14 '14 at 9:43
sorry ChartBaseStyle is redundant in this example. –  Mike Honeychurch Jul 14 '14 at 9:45