I have defined two prototypes each contain different function.
var sfSvgRender = function (element) {
this.svgLink = "http://www.w3.org/2000/svg";
this.svgObj = document.createElementNS(this.svgLink, "svg");
this._rootId = $(element).attr("id");
this.svgObj.setAttribute('id', this._rootId + '_svg');
};
sfSvgRender.prototype = new (function () {
this.drawPath = function (options, element) {
var path = document.createElementNS(this.svgLink, "path");
$(path).attr(options);
$(path).appendTo(element);
},
})();
var sfAxisRender = function (axis) {
this.currentAxis = axis;
};
sfAxisRender.prototye =new(function(){
this.drawText=function (options, label, groupEle, svgObj) {
var text = document.createElementNS(this.svgLink, "text");
$(text).attr(options);
$(text).html(label);
$(text).appendTo(groupEle);
$(groupEle).appendTo(svgObj);
}
})();
when am creating the instance for both objects first object will work properly(i.e we can able to access the method of first prototype)
but can't able to access the method of second prototype.
this.svgRenderer = new sfSvgRender(this.element);
this.axisRender=new sfAxisRender(XAxis);
this.svgRenderer works properly. but axisRender doesn't work properly.