Skip to main content
100%

fresh block

✓ Published0🌍 Public
BBenHeubl
Last edited Dec 20, 2015
Created on Dec 20, 2015

This example demonstrates an interactive bar chart where movie production costs are displayed as horizontal bars, with buttons allowing the viewer to filter by genre (Baller Movie, Drama Movie, or Comedy Movie). It shows how categorical data can be filtered dynamically through user interaction. The visualization is built with D3.js (version 3.5.5) and uses a data-driven approach where an array of movie objects is bound to the DOM. The code defines CSS classes for the bars and controls, and the `chooseFromButton` function triggers a re-render of the chart based on the selected genre. The data is embedded directly in the script, and the rendering relies on D3’s data join and selection methods to update the bar elements.

AI-generated description

Built with blockbuilder.org

Similar vizzes