mstp_map.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. /*----------------------------------------------------------
  2. map click events
  3. ------------------------------------------------------------*/
  4. var area_map = {'xining':'西宁','haibei':'海北','haidong':'海东','haixi':'海西',
  5. 'hainan':'海南','yushu':'玉树','huangnan':'黄南','guoluo':'果洛',
  6. 'geermu':'洛尔木'};
  7. var line_datas = {'xining':[[1,140], [2,150], [3,180], [4,160], [5,190], [6,170], [7,150], [8,160], [9,200], [10,160], [11,180],[12,200]],
  8. 'haibei':[[1,130], [2,120], [3,160], [4,150], [5,150], [6,150], [7,130], [8,140], [9,160], [10,160], [11,170],[12,120]],
  9. 'haidong':[[1,120], [2,150], [3,150], [4,110], [5,140], [6,130], [7,100], [8,130], [9,140], [10,170], [11,150],[12,130]],
  10. 'haixi':[[1,110], [2,140], [3,170], [4,160], [5,170], [6,170], [7,150], [8,110], [9,180], [10,140], [11,120],[12,150]],
  11. 'hainan':[[1,140], [2,130], [3,120], [4,140], [5,130], [6,170], [7,120], [8,160], [9,150], [10,130], [11,160],[12,140]],
  12. 'yushu':[[1,150], [2,110], [3,130], [4,150], [5,120], [6,130], [7,150], [8,150], [9,140], [10,150], [11,140],[12,100]],
  13. 'huangnan':[[1,160], [2,100], [3,110], [4,130], [5,110], [6,120], [7,140], [8,160], [9,120], [10,160], [11,130],[12,130]],
  14. 'guoluo':[[1,100], [2,130], [3,100], [4,120], [5,120], [6,140], [7,150], [8,120], [9,100], [10,110], [11,150],[12,160]]};
  15. var bar_data1 = [[1,5000], [2,5000], [3,5000], [4,5500], [5,6000], [6,9000], [7,8500], [8,4000], [9,5000],[10,8000],[11,6000],[12,3000]];
  16. var bar_data2 = [[1,60000],[2,55000],[3,10000], [4,8000], [5,7000], [6,20000], [7,65000], [8,50000], [9,30000],[10,36000],[11,50000],[12,60000]];
  17. var bar_data3 = [[1,60200],[2,50900],[3,60000], [4,58000], [5,60000], [6,61000], [7,59000], [8,65000], [9,50900],[10,60100],[11,50000],[12,60000]];
  18. var bar_data4 = [[1,5000], [2,5000], [3,5000], [4,5500], [5,6000], [6,9000], [7,8500], [8,4000], [9,5000],[10,8000],[11,6000],[12,3000]];
  19. var bar_data5 = [[1,60000],[2,55000],[3,10000], [4,8000], [5,7000], [6,20000], [7,65000], [8,50000], [9,30000],[10,36000],[11,50000],[12,60000]];
  20. var bar_data6 = [[1,60200],[2,50900],[3,60000], [4,58000], [5,60000], [6,61000], [7,59000], [8,65000], [9,50900],[10,60100],[11,50000],[12,60000]];
  21. var bar_data7 = [[1,5000], [2,5000], [3,5000], [4,5500], [5,6000], [6,9000], [7,8500], [8,4000], [9,5000],[10,8000],[11,6000],[12,3000]];
  22. var bar_data8 = [[1,60000],[2,55000],[3,10000], [4,8000], [5,7000], [6,20000], [7,65000], [8,50000], [9,30000],[10,36000],[11,50000],[12,60000]];
  23. var bar_data9 = [[1,60200],[2,50900],[3,60000], [4,58000], [5,60000], [6,61000], [7,59000], [8,65000], [9,50900],[10,60100],[11,50000],[12,60000]];
  24. var bar_data10 = [[1,5000], [2,5000], [3,5000], [4,5500], [5,6000], [6,9000], [7,8500], [8,4000], [9,5000],[10,8000],[11,6000],[12,3000]];
  25. var bar_data11 = [[1,60000],[2,55000],[3,10000], [4,8000], [5,7000], [6,20000], [7,65000], [8,50000], [9,30000],[10,36000],[11,50000],[12,60000]];
  26. var bar_data12 = [[1,60200],[2,50900],[3,60000], [4,58000], [5,60000], [6,61000], [7,59000], [8,65000], [9,50900],[10,60100],[11,50000],[12,60000]];
  27. var bar_data13 = [[1,5000], [2,5000], [3,5000], [4,5500], [5,6000], [6,9000], [7,8500], [8,4000], [9,5000],[10,8000],[11,6000],[12,3000]];
  28. var bar_data14 = [[1,60000],[2,55000],[3,10000], [4,8000], [5,7000], [6,20000], [7,65000], [8,50000], [9,30000],[10,36000],[11,50000],[12,60000]];
  29. var bar_data15 = [[1,60200],[2,50900],[3,60000], [4,58000], [5,60000], [6,61000], [7,59000], [8,65000], [9,50900],[10,60100],[11,50000],[12,60000]];
  30. var bar_data16 = [[1,5000], [2,5000], [3,5000], [4,5500], [5,6000], [6,9000], [7,8500], [8,4000], [9,5000],[10,8000],[11,6000],[12,3000]];
  31. var bar_data17 = [[1,60000],[2,55000],[3,10000], [4,8000], [5,7000], [6,20000], [7,65000], [8,50000], [9,30000],[10,36000],[11,50000],[12,60000]];
  32. var bar_data18 = [[1,60200],[2,50900],[3,60000], [4,58000], [5,60000], [6,61000], [7,59000], [8,65000], [9,50900],[10,60100],[11,50000],[12,60000]];
  33. var bar_data19 = [[1,5000], [2,5000], [3,5000], [4,5500], [5,6000], [6,9000], [7,8500], [8,4000], [9,5000],[10,8000],[11,6000],[12,3000]];
  34. var bar_data20 = [[1,60000],[2,55000],[3,10000], [4,8000], [5,7000], [6,20000], [7,65000], [8,50000], [9,30000],[10,36000],[11,50000],[12,60000]];
  35. var bar_data21 = [[1,60200],[2,50900],[3,60000], [4,58000], [5,60000], [6,61000], [7,59000], [8,65000], [9,50900],[10,60100],[11,50000],[12,60000]];
  36. var bar_data22 = [[1,5000], [2,5000], [3,5000], [4,5500], [5,6000], [6,9000], [7,8500], [8,4000], [9,5000],[10,8000],[11,6000],[12,3000]];
  37. var bar_data23 = [[1,60000],[2,55000],[3,10000], [4,8000], [5,7000], [6,20000], [7,65000], [8,50000], [9,30000],[10,36000],[11,50000],[12,60000]];
  38. var bar_data24 = [[1,60200],[2,50900],[3,60000], [4,58000], [5,60000], [6,61000], [7,59000], [8,65000], [9,50900],[10,60100],[11,50000],[12,60000]];
  39. var bar_datas = {
  40. 'xining':[{data : bar_data1,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  41. {data : bar_data2,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  42. {data : bar_data3,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}}],
  43. 'haibei':[{data : bar_data4,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  44. {data : bar_data5,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  45. {data : bar_data6,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}}],
  46. 'haidong':[{data : bar_data7,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  47. {data : bar_data8,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  48. {data : bar_data9,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}}],
  49. 'haixi':[{data : bar_data10,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  50. {data : bar_data11,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  51. {data : bar_data12,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}}],
  52. 'hainan':[{data : bar_data13,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  53. {data : bar_data14,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  54. {data : bar_data15,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}}],
  55. 'yushu':[{data : bar_data16,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  56. {data : bar_data17,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  57. {data : bar_data18,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}}],
  58. 'huangnan':[{data : bar_data19,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  59. {data : bar_data20,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  60. {data : bar_data21,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}}],
  61. 'guoluo':[{data : bar_data22,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  62. {data : bar_data23,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}},
  63. {data : bar_data24,label: '照明能耗',bars : {show : true, barWidth : 0.3, order : 1,fill:1,lineWidth: 0,fillColor: 'rgba(255,255,255,0.6)'}}]
  64. };
  65. function clk_map(area){
  66. //$(".absolute-area div").removeClass("active")
  67. //$(area).addClass("active");
  68. var a = $(area).attr('data');
  69. $(".area").text(area_map[a]);
  70. //lineChart.setData(line_datas[a]);
  71. //lineChart.draw();
  72. }
  73. /* --------------------------------------------------------
  74. Flot Charts
  75. -----------------------------------------------------------*/
  76. var lineChart,barChart,pieChart,donutChart;
  77. //Line Chart
  78. $(function () {
  79. if ($('#line-chart')[0]) {
  80. var d1 = [[1,140], [2,150], [3,180], [4,160], [5,190], [6,170], [7,150], [8,160], [9,200], [10,160], [11,180],[12,200]];
  81. lineChart = $.plot('#line-chart', [ {
  82. data: d1,
  83. label: "用油量",
  84. },],
  85. {
  86. series: {
  87. lines: {
  88. show: true,
  89. lineWidth: 1,
  90. fill: 0.25,
  91. },
  92. color: 'rgba(255,255,255,0.7)',
  93. shadowSize: 0,
  94. points: {
  95. show: true,
  96. }
  97. },
  98. yaxis: {
  99. min: 0,
  100. max: 300,
  101. tickColor: 'rgba(255,255,255,0.15)',
  102. tickDecimals: 0,
  103. font :{
  104. lineHeight: 13,
  105. style: "normal",
  106. color: "rgba(255,255,255,0.8)",
  107. },
  108. shadowSize: 0,
  109. },
  110. xaxis: {
  111. tickColor: 'rgba(255,255,255,0)',
  112. tickDecimals: 0,
  113. font :{
  114. lineHeight: 13,
  115. style: "normal",
  116. color: "rgba(255,255,255,0.8)",
  117. }
  118. },
  119. grid: {
  120. borderWidth: 1,
  121. borderColor: 'rgba(255,255,255,0.25)',
  122. labelMargin:10,
  123. hoverable: true,
  124. clickable: true,
  125. mouseActiveRadius:6,
  126. },
  127. legend: {
  128. show: false
  129. }
  130. });
  131. $("#line-chart").bind("plothover", function (event, pos, item) {
  132. if (item) {
  133. var x = item.datapoint[0].toFixed(2),
  134. y = item.datapoint[1].toFixed(2);
  135. $("#linechart-tooltip").html(item.series.label + ":" + y +"(吨)").css({top: item.pageY+5, left: item.pageX+5}).fadeIn(200);
  136. }
  137. else {
  138. $("#linechart-tooltip").hide();
  139. }
  140. });
  141. $("<div id='linechart-tooltip' class='chart-tooltip'></div>").appendTo("body");
  142. }
  143. });
  144. //Bar Chart
  145. $(function () {
  146. if ($("#bar-chart")[0]) {
  147. var data1 = [[3,5000], [4,5500], [5,6000], [6,9000], [7,8500], [8,4000], [9,5000],[10,8000],[11,6000],[12,3000],[1,5000],[2,5000]];
  148. var data2 = [[3,10000], [4,8000], [5,7000], [6,20000], [7,65000], [8,50000], [9,30000],[10,36000],[11,50000],[12,60000],[1,60000],[2,55000]];
  149. var data3 = [[3,60000], [4,58000], [5,60000], [6,61000], [7,59000], [8,65000], [9,50900],[10,60100],[11,50000],[12,60000],[1,60200],[2,50900]];
  150. var barData = new Array();
  151. barData.push({
  152. data : data1,
  153. label: '照明能耗',
  154. bars : {
  155. show : true,
  156. barWidth : 0.3,
  157. order : 1,
  158. fill:1,
  159. lineWidth: 0,
  160. fillColor: 'rgba(255,255,255,0.6)'
  161. }
  162. });
  163. barData.push({
  164. data : data2,
  165. label: '空调能耗',
  166. bars : {
  167. show : true,
  168. barWidth : 0.3,
  169. order : 2,
  170. fill:1,
  171. lineWidth: 0,
  172. fillColor: 'rgba(255,255,255,0.8)'
  173. }
  174. });
  175. barData.push({
  176. data : data3,
  177. label: '负载能耗',
  178. bars : {
  179. show : true,
  180. barWidth : 0.3,
  181. order : 3,
  182. fill:1,
  183. lineWidth: 0,
  184. fillColor: 'rgba(255,255,255,0.3)'
  185. }
  186. });
  187. //Display graph
  188. barChart = $.plot($("#bar-chart"), barData, {
  189. grid : {
  190. borderWidth: 1,
  191. borderColor: 'rgba(255,255,255,0.25)',
  192. show : true,
  193. hoverable : true,
  194. clickable : true,
  195. },
  196. yaxis: {
  197. tickColor: 'rgba(255,255,255,0.15)',
  198. tickDecimals: 0,
  199. font :{
  200. lineHeight: 13,
  201. style: "normal",
  202. color: "rgba(255,255,255,0.8)",
  203. },
  204. shadowSize: 0,
  205. },
  206. xaxis: {
  207. tickColor: 'rgba(255,255,255,0)',
  208. tickDecimals: 0,
  209. font :{
  210. lineHeight: 13,
  211. style: "normal",
  212. color: "rgba(255,255,255,0.8)",
  213. },
  214. shadowSize: 0,
  215. },
  216. legend : true,
  217. tooltip : true,
  218. tooltipOpts : {
  219. content : "<b>%x</b> = <span>%y</span>",
  220. defaultTheme : false
  221. }
  222. });
  223. $("#bar-chart").bind("plothover", function (event, pos, item) {
  224. if (item) {
  225. var x = item.datapoint[0].toFixed(2),
  226. y = item.datapoint[1].toFixed(2);
  227. $("#barchart-tooltip").html(item.series.label + ":" + y+"(度)").css({top: item.pageY+5, left: item.pageX+5}).fadeIn(200);
  228. }
  229. else {
  230. $("#barchart-tooltip").hide();
  231. }
  232. });
  233. $("<div id='barchart-tooltip' class='chart-tooltip'></div>").appendTo("body");
  234. }
  235. });
  236. //Pie Chart
  237. $(function(){
  238. var pieData = [
  239. {data: 1, color: 'rgba(255,200,255,0.8)',label:'照明能耗'},
  240. {data: 2, color: 'rgba(255,255,200,0.8)',label:'空调能耗'},
  241. {data: 3, color: 'rgba(200,255,255,0.8)',label:'负载能耗'}
  242. ];
  243. var donutPieData = [
  244. {data: 1, color: 'rgba(255,200,255,0.8)',label:'其他油机'},
  245. {data: 2, color: 'rgba(255,255,200,0.8)',label:'机房油机'},
  246. {data: 3, color: 'rgba(200,255,255,0.8)',label:'基站油机'}
  247. ];
  248. if($('#donut-chart')[0]){
  249. donutChart = $.plot('#donut-chart', donutPieData, {
  250. series: {
  251. pie: {
  252. innerRadius: 0.5,
  253. show: true,
  254. stroke: {
  255. width: 0,
  256. },
  257. fill: 1,
  258. fillColor: {
  259. colors : ['rgba(255, 255, 255, 0.5)', 'rgba(0, 215, 76, 0.8)', 'rgba(255,255,255,0.8)']
  260. },
  261. label: {
  262. show: true,
  263. radius: 3/4,
  264. formatter: function(label, series){
  265. return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">'+label+'<br/>'+Math.round(series.percent)+'%</div>';
  266. },
  267. background: {
  268. opacity: 0.5,
  269. color: '#000'
  270. }
  271. }
  272. }
  273. }
  274. });
  275. }
  276. if($('#pie-chart')[0]){
  277. pieChart = $.plot('#pie-chart', pieData, {
  278. series: {
  279. pie: {
  280. show: true,
  281. stroke: {
  282. width: 0,
  283. },
  284. label: {
  285. show: true,
  286. radius: 3/4,
  287. formatter: function(label, series){
  288. return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">'+label+'<br/>'+Math.round(series.percent)+'%</div>';
  289. },
  290. background: {
  291. opacity: 0.5,
  292. color: '#000'
  293. }
  294. }
  295. }
  296. }
  297. });
  298. }
  299. });
  300. //Dynamic Chart
  301. $(function() {
  302. if ($('#dynamic-chart')[0]) {
  303. var data = [],
  304. totalPoints = 300;
  305. function getRandomData() {
  306. if (data.length > 0)
  307. data = data.slice(1);
  308. while (data.length < totalPoints) {
  309. var prev = data.length > 0 ? data[data.length - 1] : 300;
  310. var y = prev + Math.random() * 10 - 5;
  311. if(y<230) y=250;
  312. if(y>380) y=350;
  313. data.push(y);
  314. }
  315. var res = [];
  316. for (var i = 0; i < data.length; ++i) {
  317. res.push([i, data[i]])
  318. }
  319. return res;
  320. }
  321. var updateInterval = 200;
  322. var plot = $.plot("#dynamic-chart", [ getRandomData(),getRandomData() ], {
  323. series: {
  324. label: "能耗",
  325. lines: {
  326. show: true,
  327. lineWidth: 1,
  328. fill: 0.25,
  329. },
  330. color: 'rgba(255,255,255,0.2)',
  331. shadowSize: 0,
  332. },
  333. yaxis: {
  334. min: 200,
  335. max: 400,
  336. tickColor: 'rgba(255,255,255,0.15)',
  337. font :{
  338. lineHeight: 13,
  339. style: "normal",
  340. color: "rgba(255,255,255,0.8)",
  341. },
  342. shadowSize: 0,
  343. },
  344. xaxis: {
  345. tickColor: 'rgba(255,255,255,0.15)',
  346. show: true,
  347. font :{
  348. lineHeight: 13,
  349. style: "normal",
  350. color: "rgba(255,255,255,0.8)",
  351. },
  352. shadowSize: 0,
  353. min: 0,
  354. max: 300
  355. },
  356. grid: {
  357. borderWidth: 1,
  358. borderColor: 'rgba(255,255,255,0.25)',
  359. labelMargin:10,
  360. hoverable: true,
  361. clickable: true,
  362. mouseActiveRadius:6,
  363. },
  364. legend: {
  365. show: false
  366. }
  367. });
  368. function update() {
  369. plot.setData([getRandomData()]);
  370. // Since the axes don't change, we don't need to call plot.setupGrid()
  371. plot.draw();
  372. setTimeout(update, updateInterval);
  373. }
  374. update();
  375. $("#dynamic-chart").bind("plothover", function (event, pos, item) {
  376. if (item) {
  377. var x = item.datapoint[0].toFixed(2),
  378. y = item.datapoint[1].toFixed(2);
  379. $("#dynamic-chart-tooltip").html(item.series.label + ":" + y+"(度)").css({top: item.pageY+5, left: item.pageX+5}).fadeIn(200);
  380. }
  381. else {
  382. $("#dynamic-chart-tooltip").hide();
  383. }
  384. });
  385. $("<div id='dynamic-chart-tooltip' class='chart-tooltip'></div>").appendTo("body");
  386. }
  387. });
  388. /* --------------------------------------------------------
  389. Sparkline
  390. -----------------------------------------------------------*/
  391. (function(){
  392. //Bar
  393. $("#stats-bar-1").sparkline([6,4,8,6,5,6,7,8,3,5,9,5,8,3], {
  394. type: 'bar',
  395. height: '50px',
  396. barWidth: 4,
  397. barColor: '#fff',
  398. barSpacing: 3,
  399. });
  400. $("#stats-bar-2").sparkline([4,7,6,2,5,3,8,6], {
  401. type: 'bar',
  402. height: '50px',
  403. barWidth: 4,
  404. barColor: '#fff',
  405. barSpacing: 3
  406. });
  407. $("#stats-bar-3").sparkline([4,7,6,2,5,3,8,6], {
  408. type: 'bar',
  409. height: '50px',
  410. barWidth: 4,
  411. barColor: '#fff',
  412. barSpacing: 3
  413. });
  414. //Line
  415. $("#stats-line").sparkline([9,4,6,5,6,4,5,7,9,3,6,5], {
  416. type: 'line',
  417. width: '100%',
  418. height: '65',
  419. lineColor: 'rgba(255,255,255,0.4)',
  420. fillColor: 'rgba(0,0,0,0.2)',
  421. lineWidth: 1.25,
  422. });
  423. $("#stats-line-2").sparkline([5,6,3,9,7,5,4,6,5,6,4,9], {
  424. type: 'line',
  425. width: '100%',
  426. height: '65',
  427. lineColor: 'rgba(255,255,255,0.4)',
  428. fillColor: 'rgba(0,0,0,0.2)',
  429. lineWidth: 1.25,
  430. });
  431. $("#stats-line-3").sparkline([8,11,9,12,10,9,13,11,12,11,10], {
  432. type: 'line',
  433. height: '65',
  434. width: '100%',
  435. lineColor: 'rgba(255,255,255,0.4)',
  436. lineWidth: 1.25,
  437. fillColor: 'rgba(0,0,0,0.2)',
  438. barWidth: 5,
  439. barColor: '#C5CED6',
  440. });
  441. $("#stats-line-4").sparkline([4,6,7,8,9,5,3,6,5,6,7,5,7,2,7], {
  442. type: 'line',
  443. height: '65',
  444. width: '100%',
  445. lineColor: 'rgba(255,255,255,0.4)',
  446. lineWidth: 1.25,
  447. fillColor: 'rgba(0,0,0,0.2)',
  448. barWidth: 5,
  449. barColor: '#C5CED6',
  450. });
  451. $("#stats-line-5").sparkline([10,9,12,10,9,13,11,12,11,10,12], {
  452. type: 'line',
  453. height: '65',
  454. width: '80',
  455. lineColor: 'rgba(255,255,255,0.4)',
  456. fillColor: 'rgba(0,0,0,0.2)',
  457. lineWidth: 1.25,
  458. barWidth: 5,
  459. barColor: '#C5CED6',
  460. });
  461. $("#stats-line-6").sparkline([7,2,7,5,7,6,5,6,3,5,9,8,6,7,4], {
  462. type: 'line',
  463. height: '65',
  464. width: '80',
  465. lineColor: 'rgba(255,255,255,0.85)',
  466. fillColor: 'rgba(0,0,0,0.2)',
  467. barWidth: 5,
  468. barColor: '#C5CED6',
  469. lineWidth: 1.25,
  470. });
  471. //Tristate
  472. $("#stats-tristate").sparkline([2,2,-2,2,-2,-2,2,2,2,2,2], {
  473. type: 'tristate',
  474. width: '100%',
  475. height: '52',
  476. barWidth: 4,
  477. barSpacing: 3,
  478. zeroAxis: false,
  479. posBarColor: '#fff',
  480. negBarColor: '#fff',
  481. zeroBarColor: '#fff',
  482. lineWidth: 0,
  483. lineColor: 'rgba(0,0,0,0)',
  484. });
  485. })();
  486. /* --------------------------------------------------------
  487. Easy Pie Charts
  488. -----------------------------------------------------------*/
  489. $(function() {
  490. $('.pie-chart-tiny').easyPieChart({
  491. easing: 'easeOutBounce',
  492. barColor: 'rgba(255,255,255,0.75)',
  493. trackColor: 'rgba(0,0,0,0.3)',
  494. scaleColor: 'rgba(255,255,255,0.3)',
  495. lineCap: 'square',
  496. lineWidth: 4,
  497. size: 100,
  498. animate: 3000,
  499. onStep: function(from, to, percent) {
  500. $(this.el).find('.percent').text(Math.round(percent));
  501. }
  502. });
  503. var chart = window.chart = $('.pie-chart-tiny').data('easyPieChart');
  504. $('.pie-chart-tiny .pie-title > i').on('click', function() {
  505. $(this).closest('.pie-chart-tiny').data('easyPieChart').update(Math.random()*200-100);
  506. });
  507. });