HTML and CSS Reference
In-Depth Information
// Create the table data object
var
tableData
=
{
…
}
// Useful variables to access table data
…
// Construct the graph
…
// Set the individual heights of bars
function
displayGraph
(
bars
) {
…
}
// Reset the graph's settings and prepare for display
function
resetGraph
() {
…
displayGraph
(
bars
);
}
// Helper functions
…
// Finally, display the graph via reset function
resetGraph
();
}
});
We pass two parameters to this function:
•
The
data
, in the form of a
table
element;
•
A
container
element, where we'd like to place our graph in the document.