Skip to main content
100%

Fork of Interactive Color Legend Bar chart with tooltip for Alcohol Vs Life Expectancy

✓ Published0🌍 Public

This chart plots alcohol consumption against life expectancy across continents, using an interactive color legend to filter data by year. Bars represent aggregated alcohol consumption on the x-axis and life expectancy on the y-axis, with a tooltip summarizing the correlation for each year. Built with D3.js v3, it uses `d3.layout.stack` for bar layout, `d3.legend.color` for the interactive legend, and `d3-tip` for tooltips. The SVG visualization animates on hover, highlighting layers while dimming the base bars, and includes custom axis formatting and tick filtering.

AI-generated description

An 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. Here, aggregate of Alcohol Consumption is considered in X Axis and Life Expectancy in Y Axis. This scatter plot would help in determining the relationship between Alcohol Consumption and Life Expectancy in various continents. The tooltip provides a summary about the above mentioned correlation with respect to the year.

Note: Skeleton of the code forked from Religions of Largest 20 Countries

P.S: Y axis does not display the values in ascending order from bottom. .Currently working on same.

MIT Licensed

Similar vizzes