(function($) { /** * @author * @constructor createChart * @param json * @returns HightChart * @since 1.0.1 */ $.fn.createChart = function(paramsData) { /* var default={ }; settings=$.extend(default,paramsData);*/ var chart=$(this).highcharts({ chart: { polar: true, marginBottom:'150', margintop:'20', opposite: true, inverted:false, borderRadius:"5", style:{ background:'#192735' }, backgroundColor: "" , /***********************************************************************/ events: { load: function () { if(1==rendState){ // set up the updating of the chart each second var series = this.series; setInterval(function () { var data=[]; $.post("/nwyj/ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getChartInfo",{comId:comId,childId:childId,typeId:"3",date:getNowDateTime()},function(result){ data=result; console.log("result====="+JSON.stringify(result)); console.log("resultthleng====="+result.length); console.log("serieslength====="+series.length); var count=0; for(var item in categorie){ for(var index in level){ for(var i in state){ if(state[i].column1=="PLON_DAOTA"){ series[count].addPoint( [getNowTime(),changeQ(result[item][state[i].column1+"_"+level[index].column]) +changeQ(result[item][state[i].column2+"_"+level[index].column]) -changeQ(result[item]["UNRECOVER_"+level[index].column])], true, true); count++; }else{ console.log("序号2:——————"+(parseInt(item*level.length)+parseInt(i)+parseInt(index*state.length))); series[count].addPoint( [getNowTime(),changeQ(result[item][state[i].column1+"_"+level[index].column])], true, true); count++; } } } } console.log("serieslength===="+series.length+";count="+count); },"json"); }, interval*1000); } } } /***********************************************************************/ }, /* title:{ align:'center', text:paramsData["title.text"], style: { color:"#ffc000", fontSize:26, fontWeight: 'bold' }},*/ title:{ text: '', floating: true }, subtitle:{ align:'right', floating:true, verticalAlign:'top', text:paramsData["subtitle.text"], style: { color:"#a73800", fontSize:18, } }, xAxis: { lineColor:'#3E4A55', labels:{ style: {color: '#ffffff',fontSize:18}, lineColor:'#0f0' }, tickColor: '#3E4A55', categories:paramsData["xAxis.categories"]}, yAxis: [{ lineWidth: 1, lineColor:'#3E4A55', title: {text:paramsData["yAxis.title.text"], opposite: true}, gridLineWidth: "1", gridLineColor:"#3E4A55", tickPositions:paramsData["yAxis.tickPositions"], labels:{ style: {color: '#ffffff'} } }], // yAxis:{categories:paramsData["yAxis.categories"]}, legend: { layout: 'horizontal', backgroundColor: 'rgba(255,255,255,0)', floating: 'true', align: 'center', verticalAlign: 'bottom', /* x:-10,*/ y:-40, itemStyle: { color: '#ffffff', fontSize:18 }, itemHoverStyle: { color: '#B6BABF' } }, credits:{enabled:false}, plotOptions: { column: { pointPadding: 1, borderWidth: 1, borderColor:null, pointWidth: 25, stacking: 'normal' } }, series: paramsData["series"], exporting: { enabled: true } }); } ; })(jQuery) ;