Interactive Legend Bar chart for Alcohol Vs Life Expectancy
This interactive bar chart displays the relationship between alcohol consumption and life expectancy across countries, color-coded by year. Built with D3.js and the d3-legend library, a hoverable color legend lets users isolate specific years from the dataset while other bars fade beneath a semi-transparent overlay. The chart uses stacked bar rendering with ordinal and linear scales, and includes tooltips via d3-tip to show detailed values. Data comes from a Life Expectancy CSV file, with SVG-based animated transitions supporting the visual filtering interaction.
AI-generated descriptionAn Interactive Color Legend bar chart for Life Expectancy Data.
This bar chart takes required inputs from the data(like Alcohol Consumption, Life Expectancy and Year) and uses these as inputs to both X and Y axes with the help of an Interactive Color Legend using 'Year' as input. This scatter plot would help in determining the relationship between Alcohol Consumption and Life Expectancy in various continents.
Note: Skeleton of the code forked from Religions of Largest 20 Countries