0ab9d80c4718a2a14c561645ac81eb18e197eede.svn-base 4.3 KB

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