
Visualize Data with a Bar Chart
- Summary: A FreeCodeCamp challenge that display a bar chart with D3.js.
- Source URL: https://codepen.io/michellemtchai/pen/BazjdzV
- Demo URL: https://codepen.io/michellemtchai/full/BazjdzV
- Stacks:
Objective
Build a CodePen.io app that fulfills the user stories and passes all the tests provided by FreeCodeCamp
Original Challenge: https://www.freecodecamp.org/learn/data-visualization/data-visualization-projects/visualize-data-with-a-bar-chart
Dataset: https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/GDP-data.json
User Stories
- My chart should have a
titlewith a correspondingid="title". - My chart should have a
gelement x-axis with a correspondingid="x-axis". - My chart should have a
gelement y-axis with a correspondingid="y-axis". - Both axes should contain multiple tick labels, each with a corresponding
class="tick". - My chart should have a
rectelement for each data point with a correspondingclass="bar"displaying the data. - Each bar should have the properties
data-dateanddata-gdpcontainingdateandGDPvalues. - The bar elements'
data-dateproperties should match the order of the provided data. - The bar elements'
data-gdpproperties should match the order of the provided data. - Each bar element's height should accurately represent the data's corresponding GDP.
- The
data-dateattribute and its corresponding bar element should align with the corresponding value on the x-axis. - The
data-gdpattribute and its corresponding bar element should align with the corresponding value on the y-axis. - I can mouse over an area and see a
tooltipwith a correspondingid="tooltip"which displays more information about the area. - My
tooltipshould have adata-dateproperty that corresponds to thedata-dateof the active area.
