RGraph=window.RGraph||{isRGraph:true};RGraph.HTML=RGraph.HTML||{};(function(win,doc,undefined) {var RG=RGraph,ua=navigator.userAgent,ma=Math;RG.drawKey=RG.DrawKey=function(obj,key,colors) {if(!key){return;} var ca=obj.canvas,co=obj.context,prop=obj.properties,keypos=prop['chart.key.position'],textsize=prop['chart.text.size'],key_non_null=[],colors_non_null=[];co.lineWidth=1;co.beginPath();if(typeof(prop['chart.key.vpos'])=='number'){obj.Set('chart.key.position.y',prop['chart.key.vpos']*prop['chart.gutter.top']);} for(var i=0;i=0;i--){var j=Number(i)+1;if(typeof(prop['chart.key.color.shape'])=='object'&&typeof(prop['chart.key.color.shape'][i])=='string'){var blob_shape=prop['chart.key.color.shape'][i];}else if(typeof(prop['chart.key.color.shape'])=='string'){var blob_shape=prop['chart.key.color.shape'];}else{var blob_shape='square';} if(blob_shape=='circle'){co.beginPath();co.fillStyle=colors[i];co.arc(hpos+5+(blob_size/2),vpos+(5*j)+(text_size*j)-text_size+(blob_size/2),blob_size/2,0,6.26,0);co.fill();}else if(blob_shape=='line'){co.beginPath();co.strokeStyle=colors[i];co.moveTo(hpos+5,vpos+(5*j)+(text_size*j)-text_size+(blob_size/2));co.lineTo(hpos+blob_size+5,vpos+(5*j)+(text_size*j)-text_size+(blob_size/2));co.stroke();}else if(blob_shape=='triangle'){co.beginPath();co.strokeStyle=colors[i];co.moveTo(hpos+5,vpos+(5*j)+(text_size*j)-text_size+blob_size);co.lineTo(hpos+(blob_size/2)+5,vpos+(5*j)+(text_size*j)-text_size);co.lineTo(hpos+blob_size+5,vpos+(5*j)+(text_size*j)-text_size+blob_size);co.closePath();co.fillStyle=colors[i];co.fill();}else{co.fillStyle=colors[i];co.fillRect(hpos+5,vpos+(5*j)+(text_size*j)-text_size,text_size,text_size+1);} co.beginPath();co.fillStyle=typeof text_color=='object'?text_color[i]:text_color;ret=RG.Text2(obj,{'font':text_font,'size':text_size,'bold':text_bold,'italic':text_italic,'x':hpos+blob_size+5+5,'y':vpos+(5*j)+(text_size*j)+3,'text':key[i]});obj.coords.key[i]=[ret.x,ret.y,ret.width,ret.height,key[i],colors[i],obj];} co.fill();} function DrawKey_gutter(obj,key,colors) {var text_size=typeof(prop['chart.key.text.size'])=='number'?prop['chart.key.text.size']:prop['chart.text.size'],text_bold=prop['chart.key.text.bold'],text_italic=prop['chart.key.text.italic'],text_font=prop['chart.key.text.font']||prop['chart.key.font']||prop['chart.text.font'],text_color=prop['chart.key.text.color'],gutterLeft=obj.gutterLeft,gutterRight=obj.gutterRight,gutterTop=obj.gutterTop,gutterBottom=obj.gutterBottom,hpos=((ca.width-gutterLeft-gutterRight)/2)+obj.gutterLeft,vpos=gutterTop-text_size-5,title=prop['chart.title'],blob_size=text_size,hmargin=8,vmargin=4,fillstyle=prop['chart.key.background'],strokestyle='#999',length=0;if(!obj.coords)obj.coords={};obj.coords.key=[];co.font=text_size+'pt '+text_font;for(i=0;i';for(var i=0;i '+(prop.links&&prop.links[i]?'':'')+''+prop.labels[i]+''+(prop.links&&prop.links[i]?'':'')+'';} div.innerHTML+=(str+'');return doc.getElementById('rgraph_key');};})(window,document);