Fork
This example visualizes the distribution of ratings across movie genres as a percentage, with each bar representing a genre and its height indicating the proportion of a specific rating level. It shows the data as a stacked bar chart where hovering over a bar reveals the exact percentage via a tooltip. Built with D3 v7, the visualization loads data from a CSV file and uses `d3.scaleBand` for the x-axis, `d3.scaleLinear` for the y-axis, and interactive mouse events to trigger tooltip transitions. The chart is rendered as an SVG with animated hover effects and lightweight styling.
AI-generated descriptionThe impact of genre on movie ratings
This stacked bar chart gives the percentage of each rating level within different movie genres. The aim is to show the impact of genre on movie ratings. When the mouse hovers over each bar, you can see pop-ups of accurate percentage of each rating level within each genre. Total percentage is 1, representing 100%.