Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity-6 Task2

Public visualization

Viewing a saved revision (read-only)

37cda4d3a0ab4817877fc95fd0051004

Activity-6 Task2

0 stars3🌍 Public
Hharshaps15@gmail.com
Last edited Apr 10, 2024
Created on Apr 10, 2024
Forked from Hello VizHub

This stacked bar chart visualizes the distribution of IMDb movie ratings across six genres, showing the proportion of films falling into five rating bands from below 5.0 to above 8.5. Each genre’s stacked bar sums to 100%, with color-coded segments revealing how documentary and animation films skew toward higher ratings while action movies concentrate in lower ranges. The visualization uses d3.stack() to compute layered data, d3.scaleOrdinal() with a custom color palette, and d3.scaleBand() for the genre axis. Hovering over any segment triggers a tooltip displaying the precise percentage, implemented through mouse events on SVG rectangles created via d3.selectAll().enter().append(). The data comes from a CSV file containing pre-aggregated percentages for each genre and rating category.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.