text: Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.BubbleChart=function(t){Sys.Extended.UI.BubbleChart.initializeBase(this,[t]);var i=this.get_id();i=i.replace("_ctl00",""),this._parentDiv=document.getElementById(i+"__ParentDiv"),this._chartWidth="300",this._chartHeight="200",this._chartTitle="",this._bubbleChartClientValues=null,this._theme="BubbleChart",this._yAxisLines=6,this._xAxisLines=6,this._bubbleSizes=5,this._chartTitleColor="",this._yAxisLineColor="",this._xAxisLineColor="",this._baseLineColor="",this._tooltipBackgroundColor="#FFFFFF",this._tooltipFontColor="#0E426C",this._tooltipBorderColor="#B85B3E",this._xAxisLabel="",this._yAxisLabel="",this._bubbleLabel="",this._axislabelFontColor="#000000",this.yMax=0,this.yMin=0,this.xMax=0,this.xMin=0,this.dataMax=0,this.dataMin=0,this.yRoundedIntervalLabelSize=0,this.xRoundedIntervalLabelSize=0,this.roundedBubbleSize=0,this.startX=0,this.startY=0,this.endX=0,this.endY=0,this.xInterval=0,this.yInterval=0,this.charLength=3.5,this._divTooltip=null},Sys.Extended.UI.BubbleChart.prototype={initialize:function(){if(Sys.Extended.UI.BubbleChart.callBaseMethod(this,"initialize"),!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"))throw"Current version of browser does not support SVG.";0==this._yAxisLines&&(this._yAxisLines=6),0==this._xAxisLines&&(this._xAxisLines=6),0==this._bubbleSizes&&(this._bubbleSizes=5),this.generateTooltipDiv(),this.generateBubbleChart()},dispose:function(){Sys.Extended.UI.BubbleChart.callBaseMethod(this,"dispose")},generateTooltipDiv:function(){this._divTooltip=$common.createElementFromTemplate({nodeName:"div",properties:{id:this.get_id()+"_tooltipDiv",style:{position:"absolute",backgroundColor:this._tooltipBackgroundColor,borderStyle:"solid",borderWidth:"5px",borderColor:this._tooltipBorderColor,left:"0px",top:"0px",color:this._tooltipFontColor,visibility:"hidden",zIndex:Sys.Extended.UI.zIndex.BubbleChartTooltip,padding:"10px"}}},this._parentDiv)},generateBubbleChart:function(){this.calculateMinMaxValues(),this.calculateBubbleSize(),this.calculateAxisValues();var t=this.intializeSVG();t+=String.format('<text x="{0}" y="{1}" id="ChartTitle" style="fill:{3}">{2}</text>',parseInt(this._chartWidth)/2-this._chartTitle.length*this.charLength,5*parseInt(this._chartHeight)/100,this._chartTitle,this._chartTitleColor),this.calculateIntervals(),t+=this.drawBackgroundHorizontalLines(),t+=this.drawBackgroundVerticalLines(),t+=this.drawBaseLines(),t+=this.drawAxisValues(),this._parentDiv.innerHTML=this._parentDiv.innerHTML+t,this.drawBubbles(this,0)},intializeSVG:function(){var t=String.format('<?xml-stylesheet type="text/css" href="{0}.css"?>',this._theme);return t=String.format('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="{0}" height="{1}" preserveAspectRatio="xMidYMid meet" viewbox="0 0 {2} {3}" style="position: relative; display: block;" onload="init(evt)">',this._chartWidth,this._chartHeight,.99*parseFloat(this._chartWidth),.99*parseFloat(this._chartHeight)),t+=String.format('<path fill="none" stroke-opacity="1" fill-opacity="1" stroke-linejoin="round" stroke-linecap="square" d="M5 {0} {1} {0} {1} {2} 5 {2} z"/>',1*parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-1*parseInt(this._chartHeight)/10),t+=String.format('<path id="ChartBackGround" stroke="" d="M0 0 {0} 0 {0} {1} 0 {1} z"/>',this._chartWidth,parseInt(this._chartHeight)-5),t+=String.format('<path fill="#ffffff" stroke-opacity="1" fill-opacity="0" stroke-linejoin="round" stroke-linecap="square" stroke="" d="M5 {0} {1} {0} {1} {2} 5 {2} z" />',1*parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-1*parseInt(this._chartHeight)/10)},drawBubbles:function(t,i){t._parentDiv.innerHTML=t._parentDiv.innerHTML.replace("</svg>","")+String.format('<circle id="Dot{4}" cx="{0}" cy="{1}" r="{2}" style="fill:{3};stroke:{3}" onmouseover="ShowTooltip(this, evt,\'{5}\',{6}, \'{7}\')" onmouseout="HideTooltip(this, evt)"></circle></svg>',t.startX+Math.round(parseFloat(t._bubbleChartClientValues[i].X)/t.xRoundedIntervalLabelSize*t.xInterval),t.startY+Math.round(-1*parseFloat(t._bubbleChartClientValues[i].Y)/t.yRoundedIntervalLabelSize*t.yInterval),Math.round(parseFloat(t._bubbleChartClientValues[i].Data)/t.roundedBubbleSize*t._bubbleSizes),t._bubbleChartClientValues[i].BubbleColor,i+1,t._bubbleChartClientValues[i].Category,t._bubbleChartClientValues[i].Data,t._bubbleLabel),i++,i<t._bubbleChartClientValues.length&&setTimeout(function(){t.drawBubbles(t,i)},400)},calculateMinMaxValues:function(){for(var t=0;t<this._bubbleChartClientValues.length;t++)0==t?(this.dataMax=parseFloat(this._bubbleChartClientValues[t].Data),this.dataMin=parseFloat(this._bubbleChartClientValues[t].Data),this.yMax=parseFloat(this._bubbleChartClientValues[t].Y),this.yMin=parseFloat(this._bubbleChartClientValues[t].Y),this.xMax=parseFloat(this._bubbleChartClientValues[t].X),this.xMin=parseFloat(this._bubbleChartClientValues[t].X)):(parseFloat(this._bubbleChartClientValues[t].Data)>this.dataMax&&(this.dataMax=parseFloat(this._bubbleChartClientValues[t].Data)),parseFloat(this._bubbleChartClientValues[t].Data)<this.dataMin&&(this.dataMin=parseFloat(this._bubbleChartClientValues[t].Data)),parseFloat(this._bubbleChartClientValues[t].X)>this.xMax&&(this.xMax=parseFloat(this._bubbleChartClientValues[t].X)),parseFloat(this._bubbleChartClientValues[t].Data)<this.xMin&&(this.xMin=parseFloat(this._bubbleChartClientValues[t].X)),parseFloat(this._bubbleChartClientValues[t].Y)>this.yMax&&(this.yMax=parseFloat(this._bubbleChartClientValues[t].Y)),parseFloat(this._bubbleChartClientValues[t].Y)<this.yMin&&(this.yMin=parseFloat(this._bubbleChartClientValues[t].Y)));this.xMin<0&&(this._xAxisLines=Math.round(this._xAxisLines/2)),this.yMin<0&&(this._yAxisLines=Math.round(this._yAxisLines/2))},calculateBubbleSize:function(){var t,i,s,e;s=this.dataMax,e=s/(this._bubbleSizes-1),i=Math.ceil(Math.log(e)/Math.log(10)-1),t=Math.pow(10,i),this.roundedBubbleSize=Math.ceil(e/t)*t},calculateAxisValues:function(){var t,i;t=this.yMin<0?this.yMax>Math.abs(this.yMin)?this.yMax:Math.abs(this.yMin):this.yMax,i=t/(this._yAxisLines-1),i<1?this.yRoundedIntervalLabelSize=i.toFixed(1):(x=Math.ceil(Math.log(i)/Math.log(10)-1),pow10x=Math.pow(10,x),this.yRoundedIntervalLabelSize=Math.ceil(i/pow10x)*pow10x);var s,e;s=this.xMin<0?this.xMax>Math.abs(this.xMin)?this.xMax:Math.abs(this.xMin):this.xMax,e=s/(this._xAxisLines-1),i<1?this.xRoundedIntervalLabelSize=e.toFixed(1):(x=Math.ceil(Math.log(e)/Math.log(10)-1),pow10x=Math.pow(10,x),this.xRoundedIntervalLabelSize=Math.ceil(e/pow10x)*pow10x)},calculateIntervals:function(){this.endX=parseFloat(this._chartWidth)-5*parseFloat(this._chartWidth)/100,this.xMin<0?this.startX=Math.round(parseFloat(this._chartWidth)+10*parseFloat(this._chartWidth)/100)/2+.5:this.startX=20*parseFloat(this._chartWidth)/100+.5,this.xMin<0?this.xInterval=(this.endX-this.startX)/this._xAxisLines:this.xInterval=Math.round((this.endX-this.startX)/this._xAxisLines),this.yMin<0?this.startY=Math.round(parseInt(this._chartHeight)-5*parseInt(this._chartHeight)/100)/2+.5:this.startY=Math.round(parseInt(this._chartHeight)-20*parseInt(this._chartHeight)/100)+.5,this.yInterval=this.startY/(this._yAxisLines+1),this.endY=this.startY-this.yInterval*this._yAxisLines},drawBackgroundHorizontalLines:function(){for(var t="",i=1;i<=this._yAxisLines;i++)t+=String.format('<path d="M{0} {2} {1} {2}" id="HorizontalLine" style="stroke:{3}"></path>',this.startX,this.endX,this.startY-this.yInterval*i,this._xAxisLineColor);if(this.yMin<0)for(var i=1;i<=this._yAxisLines;i++)t+=String.format('<path d="M{0} {2} {1} {2}" id="HorizontalLine" style="stroke:{3}"></path>',this.startX,this.endX,this.startY+this.yInterval*i,this._xAxisLineColor);if(this.xMin<0)for(var i=1;i<=this._yAxisLines;i++)t+=String.format('<path id="HorizontalLine" d="M{0} {2} {1} {2}" style="stroke:{3}"></path>',this.startX,this.startX-this.xInterval*this._xAxisLines,this.startY-this.yInterval*i,this._xAxisLineColor);if(this.xMin<0&&this.yMin<0)for(var i=1;i<=this._yAxisLines;i++)t+=String.format('<path id="HorizontalLine" d="M{0} {2} {1} {2}" style="stroke:{3}"></path>',this.startX,this.startX-this.xInterval*this._xAxisLines,this.startY+this.yInterval*i,this._xAxisLineColor);return t},drawBackgroundVerticalLines:function(){for(var t="",i=1;i<=this._xAxisLines;i++)t+=String.format('<path d="M{0} {1} {0} {2}" id="VerticalLine" style="stroke:{3}"></path>',this.startX+this.xInterval*i,this.startY,this.endY,this._yAxisLineColor);if(this.xMin<0)for(var i=1;i<=this._xAxisLines;i++)t+=String.format('<path d="M{0} {1} {0} {2}" id="VerticalLine" style="stroke:{3}"></path>',this.startX-this.xInterval*i,this.startY,this.endY,this._yAxisLineColor);if(this.yMin<0)for(var i=1;i<=this._xAxisLines;i++)t+=String.format('<path id="VerticalLine" d="M{0} {1} {0} {2}" style="stroke:{3}"></path>',this.startX+this.xInterval*i,this.startY,this.startY+this.yInterval*this._yAxisLines,this._yAxisLineColor);if(this.xMin<0&&this.yMin<0)for(var i=1;i<=this._xAxisLines;i++)t+=String.format('<path id="VerticalLine" d="M{0} {1} {0} {2}" style="stroke:{3}"></path>',this.startX-this.xInterval*i,this.startY,this.startY+this.yInterval*this._yAxisLines,this._yAxisLineColor);return t},drawBaseLines:function(){var t="";t+=String.format('<path d="M{0} {1} {2} {1}" id="BaseLine" style="stroke:{3}"></path>',this.startX,this.startY,this.endX,this._baseLineColor),t+=String.format('<path d="M{0} {1} {0} {2}" id="BaseLine" style="stroke:{3}"></path>',this.startX,this.startY,this.startY+4,this._baseLineColor),t+=String.format('<path d="M{0} {1} {0} {2}" id="BaseLine" style="stroke:{3}"></path>',this.startX,this.startY,this.endY,this._baseLineColor),t+=String.format('<path d="M{0} {1} {2} {1}" id="BaseLine" style="stroke:{3}"></path>',this.startX,this.startY,this.startX+4,this._baseLineColor);for(var i=0;i<=this._yAxisLines;i++)t+=String.format('<path d="M{0} {2} {1} {2}" id="BaseLine" style="stroke:{3}"></path>',this.startX-4,this.startX,this.startY-this.yInterval*i,this._baseLineColor);if(this.yMin<0){for(var i=1;i<=this._yAxisLines;i++)t+=String.format('<path d="M{0} {2} {1} {2}" id="BaseLine" style="stroke:{3}"></path>',this.startX-4,this.startX,this.startY+this.yInterval*i,this._baseLineColor);t+=String.format('<path d="M{0} {1} {0} {2}" id="BaseLine" style="stroke:{3}"></path>',this.startX-this.xInterval*this._xAxisLines,this.startY,this.startY+4,this._baseLineColor),t+=String.format('<path d="M{0} {1} {0} {2}" id="BaseLine" style="stroke:{3}"></path>',this.startX,this.startY,this.startY+this.yInterval*this._yAxisLines,this._baseLineColor)}for(var i=0;i<=this._xAxisLines;i++)t+=String.format('<path d="M{0} {1} {0} {2}" id="BaseLine" style="stroke:{3}"></path>',this.startX+this.xInterval*i,this.startY,this.startY+4,this._baseLineColor);if(this.xMin<0){for(var i=1;i<=this._xAxisLines;i++)t+=String.format('<path d="M{0} {1} {0} {2}" id="BaseLine" style="stroke:{3}"></path>',this.startX-this.xInterval*i,this.startY,this.startY+4,this._baseLineColor);t+=String.format('<path d="M{0} {2} {1} {2}" id="BaseLine" style="stroke:{3}"></path>',this.startX,this.startX-this.xInterval*this._xAxisLines,this.startY,this._baseLineColor)}return t},drawAxisValues:function(){for(var t="",i=0,s=1;s<=this._yAxisLines;s++)i=5.5*(10*this.yRoundedIntervalLabelSize*s/10).toString().length,t+=String.format('<text id="ValueAxis" x="{0}" y="{1}">{2}</text>',this.startX-i-10,this.startY-this.yInterval*s+4,10*this.yRoundedIntervalLabelSize*s/10);if(this.yMin<0)for(var s=1;s<=this._yAxisLines;s++)i=5.5*(10*this.yRoundedIntervalLabelSize*s/10).toString().length+5.5,t+=String.format('<text id="ValueAxis" x="{0}" y="{1}">-{2}</text>',this.startX-i-10,this.startY+this.yInterval*s+4,10*this.yRoundedIntervalLabelSize*s/10);for(var s=1;s<=this._xAxisLines;s++)i=5.5*(10*this.xRoundedIntervalLabelSize*s/10).toString().length,t+=String.format('<text id="SeriesAxis" x="{0}" y="{1}">{2}</text>',Math.round(this.startX+this.xInterval*s-i/2),this.startY+Math.round(25*this.yInterval/100)+5,10*this.xRoundedIntervalLabelSize*s/10);if(this.xMin<0)for(var s=1;s<=this._xAxisLines;s++)i=5.5*(10*this.xRoundedIntervalLabelSize*s/10).toString().length+5.5,t+=String.format('<text id="SeriesAxis" x="{0}" y="{1}">-{2}</text>',Math.round(this.startX-this.xInterval*s-i/2),this.startY+Math.round(25*this.yInterval/100)+5,10*this.xRoundedIntervalLabelSize*s/10);var e;return e=this.yMin<0?Math.round(this.startY+this.yInterval*this._yAxisLines-(this.startY-this.yInterval*this._yAxisLines))/2:Math.round((this.startY-this.endY)/2),t+=String.format('<text id="AxisLabels"  x="{0}" y="{1}" style="fill:{3};" transform="rotate(-90, {0}, {1})">{2}</text>',Math.round(5*parseFloat(this._chartWidth)/100),e+this._yAxisLabel.toString().length*this.charLength,this._yAxisLabel,this._axislabelFontColor),t+=String.format('<text id="AxisLabels" x="{0}" y="{1}" style="fill:{3};">{2}</text>',Math.round(parseInt(this._chartWidth)/2-this._xAxisLabel.toString().length*this.charLength/2),Math.round(90*parseInt(this._chartHeight)/100+5),this._xAxisLabel,this._axislabelFontColor)},get_chartWidth:function(){return this._chartWidth},set_chartWidth:function(t){this._chartWidth=t},get_chartHeight:function(){return this._chartHeight},set_chartHeight:function(t){this._chartHeight=t},get_chartTitle:function(){return this._chartTitle},set_chartTitle:function(t){this._chartTitle=t},get_bubbleChartClientValues:function(){return this._bubbleChartClientValues},set_bubbleChartClientValues:function(t){this._bubbleChartClientValues=t},get_BubbleChartClientValues:function(){return Sys.Extended.Deprecated("get_BubbleChartClientValues","get_bubbleChartClientValues"),this.get_bubbleChartClientValues()},set_BubbleChartClientValues:function(t){Sys.Extended.Deprecated("set_BubbleChartClientValues","set_bubbleChartClientValues"),this.set_bubbleChartClientValues(t)},get_theme:function(){return this._theme},set_theme:function(t){this._theme=t},get_yAxisLines:function(){return this._yAxisLines},set_yAxisLines:function(t){this._yAxisLines=t},get_xAxisLines:function(){return this._xAxisLines},set_xAxisLines:function(t){this._xAxisLines=t},get_chartTitleColor:function(){return this._chartTitleColor},set_chartTitleColor:function(t){this._chartTitleColor=t},get_yAxisLineColor:function(){return this._yAxisLineColor},set_yAxisLineColor:function(t){this._yAxisLineColor=t},get_xAxisLineColor:function(){return this._xAxisLineColor},set_xAxisLineColor:function(t){this._xAxisLineColor=t},get_bubbleSizes:function(){return this._bubbleSizes},set_bubbleSizes:function(t){this._bubbleSizes=t},get_baseLineColor:function(){return this._baseLineColor},set_baseLineColor:function(t){this._baseLineColor=t},get_tooltipBackgroundColor:function(){return this.tooltipBackgroundColor},set_tooltipBackgroundColor:function(t){this.tooltipBackgroundColor=t},get_tooltipFontColor:function(){return this._tooltipFontColor},set_tooltipFontColor:function(t){this._tooltipFontColor=t},get_tooltipBorderColor:function(){return this._tooltipBorderColor},set_tooltipBorderColor:function(t){this._tooltipBorderColor=t},get_xAxisLabel:function(){return this._xAxisLabel},set_xAxisLabel:function(t){this._xAxisLabel=t},get_yAxisLabel:function(){return this._yAxisLabel},set_yAxisLabel:function(t){this._yAxisLabel=t},get_bubbleLabel:function(){return this._bubbleLabel},set_bubbleLabel:function(t){this._bubbleLabel=t},get_axislabelFontColor:function(){return this._axislabelFontColor},set_axislabelFontColor:function(t){this._axislabelFontColor=t}},Sys.Extended.UI.BubbleChart.registerClass("Sys.Extended.UI.BubbleChart",Sys.Extended.UI.ControlBase);