function dataKLine(n,t,i){function r(r){var s=1,h="%Y-%m-%d %H:%M %A",c=[{type:"week",count:1,text:"1w"},{type:"month",count:1,text:"1m"},{type:"all",text:"所有"}],l,a="BTC/CNY",v="成交量(BTC)",u,o;n==3&&(a="LTC/CNY",v="成交量(LTC)"),t==1&&(s=0,c=[{type:"hour",count:8,text:"8h"},{type:"day",count:1,text:"1d"},]),t!=1&&(l=[{labels:{formatter:function(){return Highcharts.dateFormat("%m-%d",this.value)}}}],h="%Y-%m-%d %A");var y=[],p=[],k=r.length,w=[],b=[],f=0,e=0;for(u=0;u<k;u++)y.push([r[u][0],r[u][1],r[u][2],r[u][3],r[u][4]]),p.push([r[u][0],r[u][5]]),t!=1&&n==0&&(f+=r[u][4],u>=4&&(w.push([r[u][0],Math.floor(f/5)]),f-=r[u-4][4]),e+=r[u][4],u>=14&&(b.push([r[u][0],Math.floor(e/15)]),e-=r[u-14][4]));Highcharts.setOptions({global:{useUTC:!1},lang:{loading:"Loading...",weekdays:["周日","周一","周二","周三","周四","周五","周六"],decimalPoint:".",numericSymbols:["k","M","G","T","P","E"],resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1"},credits:{enabled:!0,text:"coin.imozhua.com",href:"https://coin.imozhua.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"10px"}}}),Highcharts.myOpt={symbolColor:"#058dc7"},o=[["week",[1]],["month",[1,2,3,4,6]]],jQuery("#container").highcharts("StockChart",{chart:{backgroundColor:i?i:"#FFF"},plotOptions:{candlestick:{color:"#d33",upColor:"#9e4",ohlc:{tooltip:{xDateFormat:"%Y-%m-%d %H:%M %A",color:"#f0f",changeDecimals:4}}},column:{color:"#1080BB"}},rangeSelector:{selected:1},colors:["#058DC7","#50B432","#ED561B","#DDDF00","#24CBE5","#64E572","#FF9655","#FFF263","#6AF9C4"],tooltip:{xDateFormat:h,color:"#f0f",changeDecimals:4,borderColor:"#058dc7"},rangeSelector:{buttons:c,selected:s,inputEnabled:!1},exporting:{enabled:!1,buttons:{exportButton:{enabled:!1},printButton:{enabled:!0}}},yAxis:[{title:{text:"价格(CNY)"},top:10,height:270,lineWidth:2,gridLineDashStyle:"ShortDot",showLastLabel:!0},{title:{text:v},top:252,height:50,lineWidth:2,gridLineColor:"#ffffff",gridLineDashStyle:"ShortDot",showLastLabel:!0,opposite:!0}],xAxis:l,series:[{type:"candlestick",name:a,data:y,yAxis:0,dataGrouping:{units:o,enabled:!1}},{type:"spline",data:w,name:"5均线",color:"black",lineWidth:1.5},{type:"spline",data:b,name:"15均线",color:"blue",lineWidth:1.5},{type:"column",name:"成交量",data:p,yAxis:1,dataGrouping:{units:o,enabled:!1}}]})}typeof external.version!="undefined"?external.run({url:"/klineData.do?marketFrom="+n+"&type="+t,_file:"proxy.dst",_runecho:function(){},_runover2:function(n,t,i){eval("json="+i),r(json)}}):jQuery.getJSON("klineData.do_type="+t+"&marketFrom="+n,r)}function klineData(n,t,i){dataKLine(n,t,i)}