var TeraChart = function(targetDom, dataset) { this.targetDom = targetDom; this.dataset = dataset; // initial data this.outerWidth = 930; this.outerHeight = 340; this.margin = { left: 60, top: 30, right: 0, bottom: 40 }; this.padding = 40; this.innerWidth = this.outerWidth - this.margin.left - this.margin.right; this.innerHeight = this.outerHeight - this.margin.top - this.margin.bottom; this.dur = 300; this.durClip = 1000; this.r1 = 4; this.r2 = this.r1 + 3; this.barWidth = 55; this._init(); }; TeraChart.prototype._init = function() { var self = this; self._setInitialDomELements(); self._setRange(); self._setInitialELements(); self.render(self.dataset); }; TeraChart.prototype.render = function(_data) { var self = this; self.data = _data; self.stackData = self._prepStackData(_data); if (self.svg) { self.svg.remove(); }; self._setInitialDomELements(); self._setDomain(); self._drawAll(); };