Skip to main content
100%

Activity_6 Question 2

✓ Published0🌍 Public
JJaiyaGhanta@my.unt.edu
Last edited Oct 22, 2024
Created on Oct 22, 2024

This stacked bar chart compares urban and rural population proportions across ten countries, with each horizontal bar segmented into two colored parts representing the population split. The visualization uses D3.js v7 with an SVG renderer, loading data from a CSV file and displaying percentages using a linear x-axis with percentage formatting. Hovering over a segment triggers a tooltip that reveals the precise percentage for that urban or rural population category. The chart includes a legend and axis labels, with colors assigned via a scaleOrdinal function using a two-color palette.

AI-generated description

Urban vs. Rural Population Distribution Stacked Bar Chart

Features:

  • D3.js for Data Visualization: The chart is built using D3.js, which dynamically loads the data and creates a scalable, interactive chart.
  • Stacked Bar Chart: Each country is represented by a bar, with the urban and rural population stacked to show the total population composition.
  • Hover Interactivity: When hovering over a bar segment, a tooltip appears, showing the precise percentage for that segment.

Instructions:

  1. Open the project in VizHub.
  2. The chart automatically loads the population data and renders the stacked bar chart.
  3. Hover over the bars to view the exact percentages of the urban and rural populations for each country.

Technologies:

  • D3.js: A powerful JavaScript library for creating dynamic and interactive data visualizations.
  • VizHub: An online platform for coding and visualizing projects using web technologies.
MIT Licensed

Similar vizzes