- index.html
In this exercise, we are going to create the same voter registration graph as we did with the chart generator, except this time you are going to code the data into a working JavaScript program.
You’ll notice that there is a lot of code already written - we are just going to focus on the code that’s nested inside the script
tag.
To complete this exercise, you will have to complete three tasks -
Input the data
- In the variable
data
there is an attribute calledseries
. Follow the directions in the comment to successfully input the voter registration data:
- In the variable
Label your Y-axis
- The variable
options
has an attributeyAxis
- follow the comments and plug in the y-axis label there.
- The variable
Label your X-axis
- The variable
options
has an attributexAxis
- follow the comments and plug in the x-axis label there.
- The variable
When you’ve input all the data, click the Run Code button - your data visualization will appear in the console! You can also click “Run HTML in New Window” to view the full graph in another window.
Challenge!
Can you figure out how to change the graph’s width and height? Check out the options
variable!
IMPORTANT: In order to see your graph when you run the code, you can’t have blank values in the series. Either fill in the blank values or remove them from the series.
Upload an image
Upload from your computer
Or paste a link here
Slides and Notes
No slides available for this video
About
WebDev