needed to draw graph after DOM loaded (containing size of svg element). Used (function() {}); for this, which places this rendering event to the back of the event queue, allowing DOM to first be loaded, before drawing the graph.