xx.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. .xxs{
  2. position: fixed; margin: 15px;
  3. right: 0;
  4. float: right;
  5. width: 400px;
  6. z-index: 4000;
  7. bottom: 0
  8. }
  9. .dsp_none{
  10. display: none;
  11. }
  12. <!-- flot -->
  13. <script type="text/javascript">
  14. //define chart clolors ( you maybe add more colors if you want or flot will add it automatic )
  15. var chartColours = ['#96CA59', '#3F97EB', '#72c380', '#6f7a8a', '#f7cb38', '#5a8022', '#2c7282'];
  16. //generate random number for charts
  17. randNum = function () {
  18. return (Math.floor(Math.random() * (1 + 40 - 20))) + 20;
  19. }
  20. $(function () {
  21. var d1 = [];
  22. //var d2 = [];
  23. //here we generate data for chart
  24. for (var i = 0; i < 30; i++) {
  25. d1.push([new Date(Date.today().add(i).days()).getTime(), randNum() + i + i + 10]);
  26. // d2.push([new Date(Date.today().add(i).days()).getTime(), randNum()]);
  27. }
  28. var chartMinDate = d1[0][0]; //first day
  29. var chartMaxDate = d1[20][0];//last day
  30. var tickSize = [1, "day"];
  31. var tformat = "%d/%m/%y";
  32. //graph options
  33. var options = {
  34. grid: {
  35. show: true,
  36. aboveData: true,
  37. color: "#3f3f3f",
  38. labelMargin: 10,
  39. axisMargin: 0,
  40. borderWidth: 0,
  41. borderColor: null,
  42. minBorderMargin: 5,
  43. clickable: true,
  44. hoverable: true,
  45. autoHighlight: true,
  46. mouseActiveRadius: 100
  47. },
  48. series: {
  49. lines: {
  50. show: true,
  51. fill: true,
  52. lineWidth: 2,
  53. steps: false
  54. },
  55. points: {
  56. show: true,
  57. radius: 4.5,
  58. symbol: "circle",
  59. lineWidth: 3.0
  60. }
  61. },
  62. legend: {
  63. position: "ne",
  64. margin: [0, -25],
  65. noColumns: 0,
  66. labelBoxBorderColor: null,
  67. labelFormatter: function (label, series) {
  68. // just add some space to labes
  69. return label + '&nbsp;&nbsp;';
  70. },
  71. width: 40,
  72. height: 1
  73. },
  74. colors: chartColours,
  75. shadowSize: 0,
  76. tooltip: true, //activate tooltip
  77. tooltipOpts: {
  78. content: "%s: %y.0",
  79. xDateFormat: "%d/%m",
  80. shifts: {
  81. x: -30,
  82. y: -50
  83. },
  84. defaultTheme: false
  85. },
  86. yaxis: {min: 0},
  87. xaxis: {
  88. mode: "time",
  89. minTickSize: tickSize,
  90. timeformat: tformat,
  91. min: chartMinDate,
  92. max: chartMaxDate
  93. }
  94. };
  95. var plot = $.plot($("#placeholder33x"),
  96. [{
  97. label: "Email Sent",
  98. data: d1,
  99. lines: {fillColor: "rgba(150, 202, 89, 0.12)"}, //#96CA59 rgba(150, 202, 89, 0.42)
  100. points: {fillColor: "#fff"}
  101. }], options);
  102. });
  103. </script>
  104. <!-- /flot -->