Line Plot comparing 2021-2022 PL teams xP to total points
This interactive line plot compares each Premier League team's expected points (xP) against their actual points across the 2021-2022 season. Users select a team via image buttons or a dropdown menu, dynamically updating the chart to display two overlaid lines: a solid line for actual points and a dashed black line for expected points. The visualization uses d3.scaleLinear and d3.line to construct the axes and series from CSV data, with team colors sourced from stadium location data.
AI-generated descriptionA scatter plot of the PL xG data with axes and a button.
Help from: https://d3-graph-gallery.com/graph/line_select.html and https://www.w3schools.com/howto/howto_js_dropdown.asp and https://www.freecodecamp.org/news/how-to-build-a-dropdown-menu-with-javascript/ and https://alvarotrigo.com/blog/drop-down-menu-javascript/ and https://www.solodev.com/blog/web-design/how-to-add-scroll-functionality-to-your-dropdowns.stml and https://www.youtube.com/watch?v=POeKjbV6TMI and https://www.w3schools.com/js/js_events.asp and https://www.sololearn.com/Discuss/422441/how-to-use-image-as-a-button-in-java-script