Use element.tagName instead of nodeName

Works with Chrome
Preferred naming convention
Document the main function
Adjust container chart dimensions

So that it always fits inside the given dimensions even with a margin.