Plots one indicator's value per country as a horizontal bar chart,
animated over Year, with countries ranked and ordered by their value in
the most recent year. Only positive, complete-case rows are kept. Returns
NULL when fewer than two rows remain after filtering (nothing
meaningful to plot/rank).
Usage
plot_bar(mfi, indicator, font_style)
Arguments
- mfi
Data frame of World Bank indicator values (long format, with
Country Name, Indicator Name, Year, value columns).
- indicator
Character. Indicator name to plot.
- font_style
A plotly font list (e.g. list(size = 20, color = "gray25")) applied to the chart's layout.
Value
A plotly htmlwidget, or NULL if there is not enough data to
plot.
Examples
plot_bar(mfi, indicator = "GDP (current US$)", font_style = font_style)