agc.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. var chart1;
  2. var chart2;
  3. var chart3;
  4. var chart4;
  5. var chart5;
  6. var chart6;
  7. var options1;
  8. var options2;
  9. var options3;
  10. var options4;
  11. var options5;
  12. var options6;
  13. Highcharts.setOptions({
  14. global : {
  15. useUTC : false
  16. }
  17. });
  18. String.prototype.endWith=function(oString){
  19. var reg=new RegExp(oString+"$");
  20. return reg.test(this);
  21. };
  22. options1= {
  23. colors: [
  24. '#00B259', //绿
  25. '#B20000', //红
  26. '#006DD9', //蓝
  27. '#000000', //黑
  28. '#FFBFFF',//藕荷色
  29. '#FF8000'//橘黄
  30. ],
  31. chart: {
  32. renderTo: 'container1',
  33. type: 'spline',
  34. zoomType: 'x',
  35. events: {
  36. }
  37. },
  38. title: {
  39. text: '红花梁AGC功率曲线'
  40. },
  41. subtitle: {
  42. text: ''
  43. },
  44. xAxis: {
  45. labels: {
  46. align: 'center',
  47. formatter: function() {
  48. return Highcharts.dateFormat('%H %M', this.value);
  49. }
  50. },
  51. //tickInterval: 5,
  52. type: 'datetime'
  53. },
  54. yAxis: [{
  55. title: {
  56. text: '功率数值(MW)'
  57. }
  58. }
  59. /* ,{
  60. title:{
  61. text :'风速(m/s)'
  62. },
  63. labels:{
  64. formatter: function(){
  65. return this.value;
  66. }
  67. },
  68. lineWidth : 1,
  69. opposite:true
  70. }*/],
  71. legend: {
  72. layout: 'vertical',
  73. // backgroundColor: '#FFFFFF',
  74. align: 'right',
  75. verticalAlign: 'top',
  76. x:-60,
  77. floating: true
  78. },
  79. tooltip: {
  80. crosshairs:{//控制十字线
  81. width:2
  82. },
  83. shared:true,
  84. xDateFormat:'%Y-%m-%d %H:%M'
  85. },
  86. credits: {
  87. enabled: false
  88. },
  89. plotOptions: {
  90. spline: {
  91. dataLabels : {
  92. enabled :false
  93. },
  94. borderWidth: 0
  95. },
  96. series: {
  97. cursor: 'pointer',
  98. marker: {
  99. radius: 0,
  100. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  101. }
  102. }
  103. },
  104. series: [{
  105. type: 'spline',
  106. name: '实际功率(单位:MW)',
  107. yAxis:0
  108. },
  109. {
  110. type: 'spline',
  111. name: 'AGC限电指令值(单位:MW)',
  112. yAxis:0
  113. },{
  114. type: 'spline',
  115. name: '预测功率(单位:MW)',
  116. yAxis:0
  117. },{
  118. type: 'spline',
  119. name: '理论功率(单位:MW)',
  120. yAxis:0
  121. }]
  122. };
  123. options2= {
  124. colors: [
  125. '#00B259', //绿
  126. '#B20000', //红
  127. '#006DD9', //蓝
  128. '#000000', //黑
  129. '#FFBFFF',//藕荷色
  130. '#FF8000'//橘黄
  131. ],
  132. chart: {
  133. renderTo: 'container2',
  134. type: 'spline',
  135. zoomType: 'x',
  136. events: {
  137. }
  138. },
  139. title: {
  140. text: '照阳河AGC功率曲线'
  141. },
  142. subtitle: {
  143. text: ''
  144. },
  145. xAxis: {
  146. labels: {
  147. align: 'center',
  148. formatter: function() {
  149. return Highcharts.dateFormat('%H %M', this.value);
  150. }
  151. },
  152. //tickInterval: 10,
  153. type: 'datetime'
  154. },
  155. yAxis: [{
  156. title: {
  157. text: '功率数值(MW)'
  158. }
  159. }
  160. /* ,{
  161. title:{
  162. text :'风速(m/s)'
  163. },
  164. labels:{
  165. formatter: function(){
  166. return this.value;
  167. }
  168. },
  169. lineWidth : 1,
  170. opposite:true
  171. }*/],
  172. legend: {
  173. layout: 'vertical',
  174. align: 'right',
  175. verticalAlign: 'top',
  176. x:-60,
  177. floating: true
  178. },
  179. tooltip: {
  180. crosshairs:{//控制十字线
  181. width:2
  182. },
  183. shared:true,
  184. xDateFormat:'%Y-%m-%d %H:%M'
  185. },
  186. credits: {
  187. enabled: false
  188. },
  189. plotOptions: {
  190. spline: {
  191. dataLabels : {
  192. enabled :false
  193. },
  194. borderWidth: 0
  195. },
  196. series: {
  197. cursor: 'pointer',
  198. marker: {
  199. radius: 0,
  200. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  201. }
  202. }
  203. },
  204. series: [{
  205. type: 'spline',
  206. name: '实际功率(单位:MW)',
  207. yAxis:0
  208. },
  209. {
  210. type: 'spline',
  211. name: 'AGC限电指令值(单位:MW)',
  212. yAxis:0
  213. },{
  214. type: 'spline',
  215. name: '预测功率(单位:MW)',
  216. yAxis:0
  217. },{
  218. type: 'spline',
  219. name: '理论功率(单位:MW)',
  220. yAxis:0
  221. }]
  222. };
  223. options3= {
  224. colors: [
  225. '#00B259', //绿
  226. '#B20000', //红
  227. '#006DD9', //蓝
  228. '#000000', //黑
  229. '#FFBFFF',//藕荷色
  230. '#FF8000'//橘黄
  231. ],
  232. chart: {
  233. renderTo: 'container3',
  234. type: 'spline',
  235. zoomType: 'x',
  236. events: {
  237. }
  238. },
  239. title: {
  240. text: '雁门关AGC功率曲线'
  241. },
  242. subtitle: {
  243. text: ''
  244. },
  245. xAxis: {
  246. labels: {
  247. align: 'center',
  248. formatter: function() {
  249. return Highcharts.dateFormat('%H %M', this.value);
  250. }
  251. },
  252. //tickInterval: 10,
  253. type: 'datetime'
  254. },
  255. yAxis: [{
  256. title: {
  257. text: '功率数值(MW)'
  258. }
  259. }
  260. /* ,{
  261. title:{
  262. text :'风速(m/s)'
  263. },
  264. labels:{
  265. formatter: function(){
  266. return this.value;
  267. }
  268. },
  269. lineWidth : 1,
  270. opposite:true
  271. }*/],
  272. legend: {
  273. layout: 'vertical',
  274. align: 'right',
  275. verticalAlign: 'top',
  276. x:-60,
  277. floating: true
  278. },
  279. tooltip: {
  280. crosshairs:{//控制十字线
  281. width:2
  282. },
  283. shared:true,
  284. xDateFormat:'%Y-%m-%d %H:%M'
  285. },
  286. credits: {
  287. enabled: false
  288. },
  289. plotOptions: {
  290. spline: {
  291. dataLabels : {
  292. enabled :false
  293. },
  294. borderWidth: 0
  295. },
  296. series: {
  297. cursor: 'pointer',
  298. marker: {
  299. radius: 0,
  300. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  301. }
  302. }
  303. },
  304. series: [{
  305. type: 'spline',
  306. name: '实际功率(单位:MW)',
  307. yAxis:0
  308. },
  309. {
  310. type: 'spline',
  311. name: 'AGC限电指令值(单位:MW)',
  312. yAxis:0
  313. },{
  314. type: 'spline',
  315. name: '预测功率(单位:MW)',
  316. yAxis:0
  317. },{
  318. type: 'spline',
  319. name: '理论功率(单位:MW)',
  320. yAxis:0
  321. }]
  322. };
  323. options4= {
  324. colors: [
  325. '#00B259', //绿
  326. '#B20000', //红
  327. '#006DD9', //蓝
  328. '#000000', //黑
  329. '#FFBFFF',//藕荷色
  330. '#FF8000'//橘黄
  331. ],
  332. chart: {
  333. renderTo: 'container1',
  334. type: 'spline',
  335. zoomType: 'x',
  336. events: {
  337. }
  338. },
  339. title: {
  340. text: '红花梁AVC电压曲线'
  341. },
  342. subtitle: {
  343. text: ''
  344. },
  345. xAxis: {
  346. labels: {
  347. align: 'center',
  348. formatter: function() {
  349. return Highcharts.dateFormat('%H %M', this.value);
  350. }
  351. },
  352. //tickInterval: 10,
  353. type: 'datetime'
  354. },
  355. yAxis: [{
  356. title: {
  357. text: '电压(KV)'
  358. }
  359. }
  360. ],
  361. legend: {
  362. layout: 'vertical',
  363. align: 'right',
  364. verticalAlign: 'top',
  365. x:-60,
  366. floating: true
  367. },
  368. tooltip: {
  369. crosshairs:{//控制十字线
  370. width:2
  371. },
  372. shared:true,
  373. xDateFormat:'%Y-%m-%d %H:%M'
  374. },
  375. credits: {
  376. enabled: false
  377. },
  378. plotOptions: {
  379. spline: {
  380. dataLabels : {
  381. enabled :false
  382. },
  383. borderWidth: 0
  384. },
  385. series: {
  386. cursor: 'pointer',
  387. marker: {
  388. radius: 0,
  389. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  390. }
  391. }
  392. },
  393. series: [{
  394. type: 'spline',
  395. name: 'AVC母线电压实际值(单位:KV)',
  396. yAxis:0
  397. },
  398. {
  399. type: 'spline',
  400. name: 'AVC母线电压调控值(单位:KV)',
  401. yAxis:0
  402. }]
  403. };
  404. options5= {
  405. colors: [
  406. '#00B259', //绿
  407. '#B20000', //红
  408. '#006DD9', //蓝
  409. '#000000', //黑
  410. '#FFBFFF',//藕荷色
  411. '#FF8000'//橘黄
  412. ],
  413. chart: {
  414. renderTo: 'container2',
  415. type: 'spline',
  416. zoomType: 'x',
  417. events: {
  418. }
  419. },
  420. title: {
  421. text: '照阳河AVC电压曲线'
  422. },
  423. subtitle: {
  424. text: ''
  425. },
  426. xAxis: {
  427. labels: {
  428. align: 'center',
  429. formatter: function() {
  430. return Highcharts.dateFormat('%H %M', this.value);
  431. }
  432. },
  433. //tickInterval: 10,
  434. type: 'datetime'
  435. },
  436. yAxis: [{
  437. title: {
  438. text: '电压(KV)'
  439. }
  440. }
  441. ],
  442. legend: {
  443. layout: 'vertical',
  444. align: 'right',
  445. verticalAlign: 'top',
  446. x:-60,
  447. floating: true
  448. },
  449. tooltip: {
  450. crosshairs:{//控制十字线
  451. width:2
  452. },
  453. shared:true,
  454. xDateFormat:'%Y-%m-%d %H:%M'
  455. },
  456. credits: {
  457. enabled: false
  458. },
  459. plotOptions: {
  460. spline: {
  461. dataLabels : {
  462. enabled :false
  463. },
  464. borderWidth: 0
  465. },
  466. series: {
  467. cursor: 'pointer',
  468. marker: {
  469. radius: 0,
  470. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  471. }
  472. }
  473. },
  474. series: [{
  475. type: 'spline',
  476. name: 'AVC母线电压实际值(单位:KV)',
  477. yAxis:0
  478. },
  479. {
  480. type: 'spline',
  481. name: 'AVC母线电压调控值(单位:KV)',
  482. yAxis:0
  483. }]
  484. };
  485. options6= {
  486. colors: [
  487. '#00B259', //绿
  488. '#B20000', //红
  489. '#006DD9', //蓝
  490. '#000000', //黑
  491. '#FFBFFF',//藕荷色
  492. '#FF8000'//橘黄
  493. ],
  494. chart: {
  495. renderTo: 'container3',
  496. type: 'spline',
  497. zoomType: 'x',
  498. events: {
  499. }
  500. },
  501. title: {
  502. text: '雁门关AVC电压曲线'
  503. },
  504. subtitle: {
  505. text: ''
  506. },
  507. xAxis: {
  508. labels: {
  509. align: 'center',
  510. formatter: function() {
  511. return Highcharts.dateFormat('%H %M', this.value);
  512. }
  513. },
  514. //tickInterval: 10,
  515. type: 'datetime'
  516. },
  517. yAxis: [{
  518. title: {
  519. text: '电压(KV)'
  520. }
  521. }
  522. ],
  523. legend: {
  524. layout: 'vertical',
  525. align: 'right',
  526. verticalAlign: 'top',
  527. x:-60,
  528. floating: true
  529. },
  530. tooltip: {
  531. crosshairs:{//控制十字线
  532. width:2
  533. },
  534. shared:true,
  535. xDateFormat:'%Y-%m-%d %H:%M'
  536. },
  537. credits: {
  538. enabled: false
  539. },
  540. plotOptions: {
  541. spline: {
  542. dataLabels : {
  543. enabled :false
  544. },
  545. borderWidth: 0
  546. },
  547. series: {
  548. cursor: 'pointer',
  549. marker: {
  550. radius: 0,
  551. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  552. }
  553. }
  554. },
  555. series: [{
  556. type: 'spline',
  557. name: 'AVC母线电压实际值(单位:KV)',
  558. yAxis:0
  559. },
  560. {
  561. type: 'spline',
  562. name: 'AVC母线电压调控值(单位:KV)',
  563. yAxis:0
  564. }]
  565. };
  566. function agcLine(wpid,type){
  567. var url = "/agc/getAgcLine.action";
  568. if(type=="s"){
  569. url = "/agc/getAgcLineForSimple.action?wpid="+wpid;
  570. }
  571. $.ajax({
  572. url : url,
  573. type : "post",
  574. cache : false,
  575. dataType : "json",
  576. data : {},
  577. ifModified : false,
  578. success : function(result) {
  579. $.each(result, function(k, v) {
  580. //alert(k +"==" + v.length)
  581. var xdgl = [];
  582. var sjgl = [];
  583. var xtime =[];
  584. var ycgl = [];
  585. var llgl =[];
  586. var index=0;
  587. var count1=0;
  588. var count2=0;
  589. var count3=0;
  590. $.each(v, function(i,obj) {
  591. if(index<obj.value8){
  592. index++;
  593. if(obj.value3!=null){
  594. ycgl.push( parseFloat(obj.value3) );
  595. }else{
  596. ycgl.push( null );
  597. }
  598. }
  599. if(count1 < obj.value6){
  600. if(obj.value1==null){
  601. sjgl.push(null);
  602. }else{
  603. sjgl.push(parseFloat(obj.value1));
  604. }
  605. count1++;
  606. }
  607. if(count2 < obj.value7){
  608. if(obj.value2==null){
  609. xdgl.push(null);
  610. }else{
  611. xdgl.push(parseFloat(obj.value2));
  612. }
  613. count2++;
  614. }
  615. if(count3 < obj.value5){
  616. if(obj.value4==null){
  617. llgl.push(null);
  618. }else{
  619. llgl.push(parseFloat(obj.value4));
  620. }
  621. count3++;
  622. }
  623. if(obj.time==null){
  624. xtime.push(null);
  625. }else{
  626. xtime.push(parseFloat(obj.time));
  627. }
  628. });
  629. if(k=="CL_FDC"){
  630. options1.series[0].data = sjgl;
  631. options1.series[1].data = xdgl;
  632. options1.series[2].data = ycgl;
  633. options1.series[3].data = llgl;
  634. options1.xAxis.categories = xtime;
  635. chart1 = new Highcharts.Chart(options1);
  636. }else if(k=="KB_FDC"){
  637. options2.series[0].data = sjgl;
  638. options2.series[1].data = xdgl;
  639. options2.series[2].data = ycgl;
  640. options2.series[3].data = llgl;
  641. options2.xAxis.categories = xtime;
  642. chart2 = new Highcharts.Chart(options2);
  643. }else if(k=="DX_FDC"){
  644. options3.series[0].data = sjgl;
  645. options3.series[1].data = xdgl;
  646. options3.series[2].data = ycgl;
  647. options3.series[3].data = llgl;
  648. options3.xAxis.categories = xtime;
  649. chart3 = new Highcharts.Chart(options3);
  650. }
  651. });
  652. /*chart1 = new Highcharts.Chart(options1);
  653. chart2 = new Highcharts.Chart(options2);
  654. chart3 = new Highcharts.Chart(options3);*/
  655. }
  656. });
  657. }