Plots the top_n countries with the largest value of one indicator as
horizontal bars, animated over Year (a "bar chart race"), for the Barplot
tab: in every frame the bars are ranked again, so a country that overtakes
another moves up. A country's missing years between two observed ones are
filled by linear interpolation, so that it does not drop out of the race
for a year and come back; nothing is filled before its first or after its
last observed year. Each bar carries the country name and its value, to 3
significant digits (1.52k, 6.02M); the bar of country is red, so that it
can be followed through the race, and the year of the frame is printed
large and gray in the bottom right corner. Only rows with a positive value
are used.
Arguments
- mfi
Data frame of World Bank indicator values (long format, with
Country Name,Indicator Name,Year,valuecolumns).- indicator
Character. Indicator name to plot.
- font_style
A
plotlyfont list for the layout of the chart; the app passes font_style.- top_n
Integer. Number of countries shown in each year.
- country
Character. Country whose bar is drawn red (
NULLfor none).