UNPKG

dzxstatic

Version:

The static files of Discuz! X

1 lines 1.32 kB
function drawstatchart(t){if(BROWSER.ie&&BROWSER.ie<9)$("statchart").innerHTML=AC_FL_RunContent("width","100%","height","300","src",STATICURL+"image/common/stat.swf?path=&settings_file=data/stat_setting.xml&data_file="+encodeURIComponent(t),"quality","high","wmode","transparent");else{var e=new Ajax;e.recvType="HTML",$("statchart").style.width="100%",$("statchart").style.height="400px",e.get(t,(function(t,e){var a=echarts.init($("statchart"));option={grid:{left:60,right:20},xAxis:{type:"category",data:[]},yAxis:{type:"value"},tooltip:{trigger:"axis",textStyle:{fontSize:12}},series:[],legend:{type:"scroll",data:[],left:60,bottom:10}};var i=e.XMLHttpRequest.responseXML,n=i.getElementsByTagName("xaxis")[0].childNodes;n.length||(option.title={text:"There is no data for selected period",padding:[10,50],textAlign:"center",textVerticalAlign:"center",left:"50%",top:"50%",backgroundColor:"#e8f0f7"});for(var s=0;s<n.length;s++)option.xAxis.data.push(n[s].firstChild.nodeValue);s=0;for(var o=i.getElementsByTagName("graphs")[0].childNodes;s<o.length;s++){qttl=o[s].getAttribute("title"),option.legend.data.push(qttl),qdata={type:"line",name:qttl,data:[]};for(var r=0;r<o[s].childNodes.length;r++)qdata.data.push(parseInt(o[s].childNodes[r].firstChild.nodeValue));option.series.push(qdata)}a.setOption(option)}))}}