Message Boards Message Boards

0
|
2218 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

BarChart labels: label for each group of bars

Posted 2 years ago

Trying to set 1999 on top of the first group (of 6 bars), 2009 over the 2nd group of 6 bars, and 2019 over the 3 group (of 6 bars).

Thank you.

POSTED BY: Jon Locke
5 Replies
Posted 2 years ago

Thank you, learning a lot.

POSTED BY: Jon Locke
Posted 2 years ago

Another option for dealing with a large range of values is to use a log scale.

LabelingFunction -> (Placed[Rotate[AccountingForm[#, DigitBlock -> 3], Pi/2], If[# < 2*10^3, Above, Top]] &),
ScalingFunctions -> "Log",

enter image description here

POSTED BY: Rohit Namjoshi
Posted 2 years ago

Jon,

You have data for 6 countries, but the legend only shows 5. I think the missing country is Italy. Since the values vary so much, the bars for three of the countries are very small. This may be a better way

BarChart[alist,
 ChartLabels -> {{"1999", "2009", "2019"}, None},
 LabelStyle -> 16,
 PlotTheme -> "Detailed",
 ChartStyle -> ColorData[24],
 PlotLabel -> Style["Gross Domestic Product of 6 EU Countries", Black],
 FrameLabel -> {"Year", "Millions of € / Year"},
 ChartLegends -> {"Germany", "Estonia", "France", "Italy", "Malta", "Iceland"},
 LabelingFunction -> (Placed[Rotate[AccountingForm[#, DigitBlock -> 3], Pi/2], If[# < 10^6, Above, Top]] &),
 ImageSize -> 600]

enter image description here

For 3D

countries = {"Germany", "Estonia", "France", "Italy", "Malta", "Iceland"};
countryLabels = Style["\n\n\n" <> #, 11, Black] & /@ countries;

BarChart3D[alist,
 ChartLayout -> "Grid",
 ChartStyle -> "Pastel",
 ChartLabels -> {Style[#, 11, Black] & /@ {"1999", "2009", "2019"}, countryLabels},
 LabelingFunction -> Top,
 ImageSize -> 600]

enter image description here

You can add title, labels, ...

POSTED BY: Rohit Namjoshi
Posted 2 years ago
BarChart[alist,
 ChartLabels -> {Callout[{"1999", "2009", "2019"}], None},
 LabelStyle -> 16,
 PlotTheme -> "Detailed",
 PlotLabel -> Style["Gross Domestic Product of 6 EU Countries", Black],
 ImageSize -> 600]

enter image description here

But it is not very informative because the country names are not labeled or legended, the currency is not specified, ....

POSTED BY: Rohit Namjoshi
Posted 2 years ago

Thank you Rohit, I added a Legend to identify the countries. Another question, is it possible to made it 3dChart. I tried and would not work. And on the Y axis is Euros Do you have a better Idea to express the Euros?

POSTED BY: Jon Locke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract