70021d51ae3c89ee9bae1d8f81badf506d48e45c.svn-base 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. (function($) {
  2. /**
  3. * @author
  4. * @constructor createChart
  5. * @param json
  6. * @returns HightChart
  7. * @since 1.0.1
  8. */
  9. $.fn.createChart = function(paramsData) {
  10. /* var default={
  11. };
  12. settings=$.extend(default,paramsData);*/
  13. var chart=$(this).highcharts({
  14. chart: {
  15. polar: true,
  16. marginBottom:'150',
  17. margintop:'20',
  18. opposite: true,
  19. inverted:false,
  20. borderRadius:"5",
  21. style:{
  22. background:'#192735'
  23. },
  24. backgroundColor: "" ,
  25. /***********************************************************************/
  26. events: {
  27. load: function () {
  28. if(1==rendState){
  29. // set up the updating of the chart each second
  30. var series = this.series;
  31. setInterval(function () {
  32. var data=[];
  33. $.post("/nwyj/ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getChartInfo",{comId:comId,childId:childId,typeId:"3",date:getNowDateTime()},function(result){
  34. data=result;
  35. console.log("result====="+JSON.stringify(result));
  36. console.log("resultthleng====="+result.length);
  37. console.log("serieslength====="+series.length);
  38. var count=0;
  39. for(var item in categorie){
  40. for(var index in level){
  41. for(var i in state){
  42. if(state[i].column1=="PLON_DAOTA"){
  43. series[count].addPoint(
  44. [getNowTime(),changeQ(result[item][state[i].column1+"_"+level[index].column])
  45. +changeQ(result[item][state[i].column2+"_"+level[index].column])
  46. -changeQ(result[item]["UNRECOVER_"+level[index].column])], true, true);
  47. count++;
  48. }else{
  49. console.log("序号2:——————"+(parseInt(item*level.length)+parseInt(i)+parseInt(index*state.length)));
  50. series[count].addPoint(
  51. [getNowTime(),changeQ(result[item][state[i].column1+"_"+level[index].column])], true, true);
  52. count++;
  53. }
  54. }
  55. }
  56. }
  57. console.log("serieslength===="+series.length+";count="+count);
  58. },"json");
  59. }, interval*1000);
  60. }
  61. }
  62. }
  63. /***********************************************************************/
  64. },
  65. /* title:{
  66. align:'center',
  67. text:paramsData["title.text"],
  68. style: {
  69. color:"#ffc000",
  70. fontSize:26,
  71. fontWeight: 'bold'
  72. }},*/
  73. title:{
  74. text: '',
  75. floating: true
  76. },
  77. subtitle:{
  78. align:'right',
  79. floating:true,
  80. verticalAlign:'top',
  81. text:paramsData["subtitle.text"],
  82. style: {
  83. color:"#a73800",
  84. fontSize:18,
  85. }
  86. },
  87. xAxis: {
  88. lineColor:'#3E4A55',
  89. labels:{
  90. style: {color: '#ffffff',fontSize:18},
  91. lineColor:'#0f0'
  92. },
  93. tickColor: '#3E4A55',
  94. categories:paramsData["xAxis.categories"]},
  95. yAxis: [{
  96. lineWidth: 1,
  97. lineColor:'#3E4A55',
  98. title: {text:paramsData["yAxis.title.text"], opposite: true},
  99. gridLineWidth: "1",
  100. gridLineColor:"#3E4A55",
  101. tickPositions:paramsData["yAxis.tickPositions"],
  102. labels:{
  103. style: {color: '#ffffff'}
  104. }
  105. }],
  106. // yAxis:{categories:paramsData["yAxis.categories"]},
  107. legend: {
  108. layout: 'horizontal',
  109. backgroundColor: 'rgba(255,255,255,0)',
  110. floating: 'true',
  111. align: 'center',
  112. verticalAlign: 'bottom',
  113. /* x:-10,*/
  114. y:-40,
  115. itemStyle: {
  116. color: '#ffffff',
  117. fontSize:18
  118. },
  119. itemHoverStyle: {
  120. color: '#B6BABF'
  121. }
  122. },
  123. credits:{enabled:false},
  124. plotOptions: {
  125. column: {
  126. pointPadding: 1,
  127. borderWidth: 1,
  128. borderColor:null,
  129. pointWidth: 25,
  130. stacking: 'normal'
  131. }
  132. },
  133. series: paramsData["series"],
  134. exporting: {
  135. enabled: true
  136. }
  137. });
  138. } ;
  139. })(jQuery) ;