wtinfo.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. 
  2. var chart1;
  3. var options1;
  4. Highcharts.setOptions({
  5. global : {
  6. useUTC : false
  7. }
  8. });
  9. String.prototype.endWith=function(oString){
  10. var reg=new RegExp(oString+"$");
  11. return reg.test(this);
  12. }
  13. options1= {
  14. colors: [
  15. '#B20000' //红
  16. ],
  17. chart: {
  18. renderTo: 'container2',
  19. type: 'spline',
  20. //backgroundColor:'#BFDFFF',
  21. //plotBackgroundColor:'#BFDFFF',
  22. zoomType: 'x',
  23. events: {
  24. }
  25. },
  26. title: {
  27. text: '功率曲线'
  28. },
  29. subtitle: {
  30. text: ''
  31. },
  32. xAxis: {
  33. labels: {
  34. align: 'center',
  35. formatter: function() {
  36. return Highcharts.dateFormat('%H<br/>%M', this.value);
  37. }
  38. },
  39. type: 'datetime'
  40. },
  41. yAxis: [{
  42. title: {
  43. text: '功率数值(MW)'
  44. }
  45. }],
  46. legend: {
  47. layout: 'vertical',
  48. // backgroundColor: '#FFFFFF',
  49. align: 'right',
  50. verticalAlign: 'top',
  51. floating: true
  52. // shadow: true
  53. // layout: 'vertical',
  54. // align: 'right',
  55. // verticalAlign: 'middle',
  56. // borderWidth: 0
  57. },
  58. tooltip: {
  59. crosshairs:{//控制十字线
  60. width:2
  61. },
  62. shared:true,
  63. xDateFormat:'%Y-%m-%d %H:%M'
  64. /*formatter: function() {
  65. return '<b>'+ this.series.name +'</b>:'+
  66. Highcharts.numberFormat(this.y, 2) +' 万kW<br/>时间:'+
  67. Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x);
  68. }*/
  69. },
  70. credits: {
  71. enabled: false
  72. },
  73. plotOptions: {
  74. spline: {
  75. dataLabels : {
  76. enabled :false
  77. },
  78. // pointPadding: 0.2,
  79. borderWidth: 0
  80. },
  81. series: {
  82. cursor: 'pointer',
  83. marker: {
  84. radius: 0,
  85. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  86. }
  87. }
  88. },
  89. series: [
  90. {
  91. type: 'spline',
  92. name: '实发功率(单位:MW)',
  93. yAxis:0
  94. }]
  95. };