Skip to main content
100%

Week2

✓ Published0🌍 Public
NN0taN3rd
Last edited Jan 27, 2016
Created on Jan 24, 2016

This bar chart shows the number of countries participating in the Summer Olympics from 1896 to 2012, with each bar representing one Olympic year. The visualization animates the bars and includes a tooltip displaying the host city and country when hovering over each bar. Built with D3.js v3, the chart uses d3.scale.ordinal and d3.scale.linear for positioning, d3.svg.axis for axes, and SVG rectangles to render the data from data.json.

AI-generated description

Built with blockbuilder.org

R code to accompany the week2 d3 portion

countries <- c(12, 31, 15, 21, 22, 29, 29, 45, 46, 47, 49, 59, 
               69, 67, 83, 93, 112, 121, 92, 80, 140, 159, 169, 197, 200, 201, 204, 205)
years <- c(1896, 1900, 1904, 1906, 1908, 1912, 1920, 1924, 1928, 1932, 1936, 
           1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012)

barX <- barplot(countries,xlab = "Years", beside=TRUE)
text(barX, 0, round(years,1),cex=0.8, pos=3,srt=90)

week2

Similar vizzes