flot-demo.js 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267
  1. //Flot Bar Chart
  2. $(function() {
  3. var barOptions = {
  4. series: {
  5. bars: {
  6. show: true,
  7. barWidth: 0.6,
  8. fill: true,
  9. fillColor: {
  10. colors: [{
  11. opacity: 0.8
  12. }, {
  13. opacity: 0.8
  14. }]
  15. }
  16. }
  17. },
  18. xaxis: {
  19. tickDecimals: 0
  20. },
  21. colors: ["#1ab394"],
  22. grid: {
  23. color: "#999999",
  24. hoverable: true,
  25. clickable: true,
  26. tickColor: "#D4D4D4",
  27. borderWidth:0
  28. },
  29. legend: {
  30. show: false
  31. },
  32. tooltip: true,
  33. tooltipOpts: {
  34. content: "x: %x, y: %y"
  35. }
  36. };
  37. var barData = {
  38. label: "bar",
  39. data: [
  40. [1, 34],
  41. [2, 25],
  42. [3, 19],
  43. [4, 34],
  44. [5, 32],
  45. [6, 44]
  46. ]
  47. };
  48. $.plot($("#flot-bar-chart"), [barData], barOptions);
  49. });
  50. $(function() {
  51. var barOptions = {
  52. series: {
  53. lines: {
  54. show: true,
  55. lineWidth: 2,
  56. fill: true,
  57. fillColor: {
  58. colors: [{
  59. opacity: 0.0
  60. }, {
  61. opacity: 0.0
  62. }]
  63. }
  64. }
  65. },
  66. xaxis: {
  67. tickDecimals: 0
  68. },
  69. colors: ["#1ab394"],
  70. grid: {
  71. color: "#999999",
  72. hoverable: true,
  73. clickable: true,
  74. tickColor: "#D4D4D4",
  75. borderWidth:0
  76. },
  77. legend: {
  78. show: false
  79. },
  80. tooltip: true,
  81. tooltipOpts: {
  82. content: "x: %x, y: %y"
  83. }
  84. };
  85. var barData = {
  86. label: "bar",
  87. data: [
  88. [1, 34],
  89. [2, 25],
  90. [3, 19],
  91. [4, 34],
  92. [5, 32],
  93. [6, 44]
  94. ]
  95. };
  96. $.plot($("#flot-line-chart"), [barData], barOptions);
  97. });
  98. //Flot Pie Chart
  99. $(function() {
  100. var data = [{
  101. label: "数据 1",
  102. data: 21,
  103. color: "#d3d3d3",
  104. }, {
  105. label: "数据 2",
  106. data: 3,
  107. color: "#bababa",
  108. }, {
  109. label: "数据 3",
  110. data: 15,
  111. color: "#79d2c0",
  112. }, {
  113. label: "数据 4",
  114. data: 52,
  115. color: "#1ab394",
  116. }];
  117. var plotObj = $.plot($("#flot-pie-chart"), data, {
  118. series: {
  119. pie: {
  120. show: true
  121. }
  122. },
  123. grid: {
  124. hoverable: true
  125. },
  126. tooltip: true,
  127. tooltipOpts: {
  128. content: "%p.0%, %s", // show percentages, rounding to 2 decimal places
  129. shifts: {
  130. x: 20,
  131. y: 0
  132. },
  133. defaultTheme: false
  134. }
  135. });
  136. });
  137. $(function() {
  138. var container = $("#flot-line-chart-moving");
  139. // Determine how many data points to keep based on the placeholder's initial size;
  140. // this gives us a nice high-res plot while avoiding more than one point per pixel.
  141. var maximum = container.outerWidth() / 2 || 300;
  142. //
  143. var data = [];
  144. function getRandomData() {
  145. if (data.length) {
  146. data = data.slice(1);
  147. }
  148. while (data.length < maximum) {
  149. var previous = data.length ? data[data.length - 1] : 50;
  150. var y = previous + Math.random() * 10 - 5;
  151. data.push(y < 0 ? 0 : y > 100 ? 100 : y);
  152. }
  153. // zip the generated y values with the x values
  154. var res = [];
  155. for (var i = 0; i < data.length; ++i) {
  156. res.push([i, data[i]])
  157. }
  158. return res;
  159. }
  160. //
  161. series = [{
  162. data: getRandomData(),
  163. lines: {
  164. fill: true
  165. }
  166. }];
  167. //
  168. var plot = $.plot(container, series, {
  169. grid: {
  170. color: "#999999",
  171. tickColor: "#D4D4D4",
  172. borderWidth:0,
  173. minBorderMargin: 20,
  174. labelMargin: 10,
  175. backgroundColor: {
  176. colors: ["#ffffff", "#ffffff"]
  177. },
  178. margin: {
  179. top: 8,
  180. bottom: 20,
  181. left: 20
  182. },
  183. markings: function(axes) {
  184. var markings = [];
  185. var xaxis = axes.xaxis;
  186. for (var x = Math.floor(xaxis.min); x < xaxis.max; x += xaxis.tickSize * 2) {
  187. markings.push({
  188. xaxis: {
  189. from: x,
  190. to: x + xaxis.tickSize
  191. },
  192. color: "#fff"
  193. });
  194. }
  195. return markings;
  196. }
  197. },
  198. colors: ["#1ab394"],
  199. xaxis: {
  200. tickFormatter: function() {
  201. return "";
  202. }
  203. },
  204. yaxis: {
  205. min: 0,
  206. max: 110
  207. },
  208. legend: {
  209. show: true
  210. }
  211. });
  212. // Update the random dataset at 25FPS for a smoothly-animating chart
  213. setInterval(function updateRandom() {
  214. series[0].data = getRandomData();
  215. plot.setData(series);
  216. plot.draw();
  217. }, 40);
  218. });
  219. //Flot Multiple Axes Line Chart
  220. $(function() {
  221. var oilprices = [
  222. [1167692400000, 61.05],
  223. [1167778800000, 58.32],
  224. [1167865200000, 57.35],
  225. [1167951600000, 56.31],
  226. [1168210800000, 55.55],
  227. [1168297200000, 55.64],
  228. [1168383600000, 54.02],
  229. [1168470000000, 51.88],
  230. [1168556400000, 52.99],
  231. [1168815600000, 52.99],
  232. [1168902000000, 51.21],
  233. [1168988400000, 52.24],
  234. [1169074800000, 50.48],
  235. [1169161200000, 51.99],
  236. [1169420400000, 51.13],
  237. [1169506800000, 55.04],
  238. [1169593200000, 55.37],
  239. [1169679600000, 54.23],
  240. [1169766000000, 55.42],
  241. [1170025200000, 54.01],
  242. [1170111600000, 56.97],
  243. [1170198000000, 58.14],
  244. [1170284400000, 58.14],
  245. [1170370800000, 59.02],
  246. [1170630000000, 58.74],
  247. [1170716400000, 58.88],
  248. [1170802800000, 57.71],
  249. [1170889200000, 59.71],
  250. [1170975600000, 59.89],
  251. [1171234800000, 57.81],
  252. [1171321200000, 59.06],
  253. [1171407600000, 58.00],
  254. [1171494000000, 57.99],
  255. [1171580400000, 59.39],
  256. [1171839600000, 59.39],
  257. [1171926000000, 58.07],
  258. [1172012400000, 60.07],
  259. [1172098800000, 61.14],
  260. [1172444400000, 61.39],
  261. [1172530800000, 61.46],
  262. [1172617200000, 61.79],
  263. [1172703600000, 62.00],
  264. [1172790000000, 60.07],
  265. [1173135600000, 60.69],
  266. [1173222000000, 61.82],
  267. [1173308400000, 60.05],
  268. [1173654000000, 58.91],
  269. [1173740400000, 57.93],
  270. [1173826800000, 58.16],
  271. [1173913200000, 57.55],
  272. [1173999600000, 57.11],
  273. [1174258800000, 56.59],
  274. [1174345200000, 59.61],
  275. [1174518000000, 61.69],
  276. [1174604400000, 62.28],
  277. [1174860000000, 62.91],
  278. [1174946400000, 62.93],
  279. [1175032800000, 64.03],
  280. [1175119200000, 66.03],
  281. [1175205600000, 65.87],
  282. [1175464800000, 64.64],
  283. [1175637600000, 64.38],
  284. [1175724000000, 64.28],
  285. [1175810400000, 64.28],
  286. [1176069600000, 61.51],
  287. [1176156000000, 61.89],
  288. [1176242400000, 62.01],
  289. [1176328800000, 63.85],
  290. [1176415200000, 63.63],
  291. [1176674400000, 63.61],
  292. [1176760800000, 63.10],
  293. [1176847200000, 63.13],
  294. [1176933600000, 61.83],
  295. [1177020000000, 63.38],
  296. [1177279200000, 64.58],
  297. [1177452000000, 65.84],
  298. [1177538400000, 65.06],
  299. [1177624800000, 66.46],
  300. [1177884000000, 64.40],
  301. [1178056800000, 63.68],
  302. [1178143200000, 63.19],
  303. [1178229600000, 61.93],
  304. [1178488800000, 61.47],
  305. [1178575200000, 61.55],
  306. [1178748000000, 61.81],
  307. [1178834400000, 62.37],
  308. [1179093600000, 62.46],
  309. [1179180000000, 63.17],
  310. [1179266400000, 62.55],
  311. [1179352800000, 64.94],
  312. [1179698400000, 66.27],
  313. [1179784800000, 65.50],
  314. [1179871200000, 65.77],
  315. [1179957600000, 64.18],
  316. [1180044000000, 65.20],
  317. [1180389600000, 63.15],
  318. [1180476000000, 63.49],
  319. [1180562400000, 65.08],
  320. [1180908000000, 66.30],
  321. [1180994400000, 65.96],
  322. [1181167200000, 66.93],
  323. [1181253600000, 65.98],
  324. [1181599200000, 65.35],
  325. [1181685600000, 66.26],
  326. [1181858400000, 68.00],
  327. [1182117600000, 69.09],
  328. [1182204000000, 69.10],
  329. [1182290400000, 68.19],
  330. [1182376800000, 68.19],
  331. [1182463200000, 69.14],
  332. [1182722400000, 68.19],
  333. [1182808800000, 67.77],
  334. [1182895200000, 68.97],
  335. [1182981600000, 69.57],
  336. [1183068000000, 70.68],
  337. [1183327200000, 71.09],
  338. [1183413600000, 70.92],
  339. [1183586400000, 71.81],
  340. [1183672800000, 72.81],
  341. [1183932000000, 72.19],
  342. [1184018400000, 72.56],
  343. [1184191200000, 72.50],
  344. [1184277600000, 74.15],
  345. [1184623200000, 75.05],
  346. [1184796000000, 75.92],
  347. [1184882400000, 75.57],
  348. [1185141600000, 74.89],
  349. [1185228000000, 73.56],
  350. [1185314400000, 75.57],
  351. [1185400800000, 74.95],
  352. [1185487200000, 76.83],
  353. [1185832800000, 78.21],
  354. [1185919200000, 76.53],
  355. [1186005600000, 76.86],
  356. [1186092000000, 76.00],
  357. [1186437600000, 71.59],
  358. [1186696800000, 71.47],
  359. [1186956000000, 71.62],
  360. [1187042400000, 71.00],
  361. [1187301600000, 71.98],
  362. [1187560800000, 71.12],
  363. [1187647200000, 69.47],
  364. [1187733600000, 69.26],
  365. [1187820000000, 69.83],
  366. [1187906400000, 71.09],
  367. [1188165600000, 71.73],
  368. [1188338400000, 73.36],
  369. [1188511200000, 74.04],
  370. [1188856800000, 76.30],
  371. [1189116000000, 77.49],
  372. [1189461600000, 78.23],
  373. [1189548000000, 79.91],
  374. [1189634400000, 80.09],
  375. [1189720800000, 79.10],
  376. [1189980000000, 80.57],
  377. [1190066400000, 81.93],
  378. [1190239200000, 83.32],
  379. [1190325600000, 81.62],
  380. [1190584800000, 80.95],
  381. [1190671200000, 79.53],
  382. [1190757600000, 80.30],
  383. [1190844000000, 82.88],
  384. [1190930400000, 81.66],
  385. [1191189600000, 80.24],
  386. [1191276000000, 80.05],
  387. [1191362400000, 79.94],
  388. [1191448800000, 81.44],
  389. [1191535200000, 81.22],
  390. [1191794400000, 79.02],
  391. [1191880800000, 80.26],
  392. [1191967200000, 80.30],
  393. [1192053600000, 83.08],
  394. [1192140000000, 83.69],
  395. [1192399200000, 86.13],
  396. [1192485600000, 87.61],
  397. [1192572000000, 87.40],
  398. [1192658400000, 89.47],
  399. [1192744800000, 88.60],
  400. [1193004000000, 87.56],
  401. [1193090400000, 87.56],
  402. [1193176800000, 87.10],
  403. [1193263200000, 91.86],
  404. [1193612400000, 93.53],
  405. [1193698800000, 94.53],
  406. [1193871600000, 95.93],
  407. [1194217200000, 93.98],
  408. [1194303600000, 96.37],
  409. [1194476400000, 95.46],
  410. [1194562800000, 96.32],
  411. [1195081200000, 93.43],
  412. [1195167600000, 95.10],
  413. [1195426800000, 94.64],
  414. [1195513200000, 95.10],
  415. [1196031600000, 97.70],
  416. [1196118000000, 94.42],
  417. [1196204400000, 90.62],
  418. [1196290800000, 91.01],
  419. [1196377200000, 88.71],
  420. [1196636400000, 88.32],
  421. [1196809200000, 90.23],
  422. [1196982000000, 88.28],
  423. [1197241200000, 87.86],
  424. [1197327600000, 90.02],
  425. [1197414000000, 92.25],
  426. [1197586800000, 90.63],
  427. [1197846000000, 90.63],
  428. [1197932400000, 90.49],
  429. [1198018800000, 91.24],
  430. [1198105200000, 91.06],
  431. [1198191600000, 90.49],
  432. [1198710000000, 96.62],
  433. [1198796400000, 96.00],
  434. [1199142000000, 99.62],
  435. [1199314800000, 99.18],
  436. [1199401200000, 95.09],
  437. [1199660400000, 96.33],
  438. [1199833200000, 95.67],
  439. [1200351600000, 91.90],
  440. [1200438000000, 90.84],
  441. [1200524400000, 90.13],
  442. [1200610800000, 90.57],
  443. [1200956400000, 89.21],
  444. [1201042800000, 86.99],
  445. [1201129200000, 89.85],
  446. [1201474800000, 90.99],
  447. [1201561200000, 91.64],
  448. [1201647600000, 92.33],
  449. [1201734000000, 91.75],
  450. [1202079600000, 90.02],
  451. [1202166000000, 88.41],
  452. [1202252400000, 87.14],
  453. [1202338800000, 88.11],
  454. [1202425200000, 91.77],
  455. [1202770800000, 92.78],
  456. [1202857200000, 93.27],
  457. [1202943600000, 95.46],
  458. [1203030000000, 95.46],
  459. [1203289200000, 101.74],
  460. [1203462000000, 98.81],
  461. [1203894000000, 100.88],
  462. [1204066800000, 99.64],
  463. [1204153200000, 102.59],
  464. [1204239600000, 101.84],
  465. [1204498800000, 99.52],
  466. [1204585200000, 99.52],
  467. [1204671600000, 104.52],
  468. [1204758000000, 105.47],
  469. [1204844400000, 105.15],
  470. [1205103600000, 108.75],
  471. [1205276400000, 109.92],
  472. [1205362800000, 110.33],
  473. [1205449200000, 110.21],
  474. [1205708400000, 105.68],
  475. [1205967600000, 101.84],
  476. [1206313200000, 100.86],
  477. [1206399600000, 101.22],
  478. [1206486000000, 105.90],
  479. [1206572400000, 107.58],
  480. [1206658800000, 105.62],
  481. [1206914400000, 101.58],
  482. [1207000800000, 100.98],
  483. [1207173600000, 103.83],
  484. [1207260000000, 106.23],
  485. [1207605600000, 108.50],
  486. [1207778400000, 110.11],
  487. [1207864800000, 110.14],
  488. [1208210400000, 113.79],
  489. [1208296800000, 114.93],
  490. [1208383200000, 114.86],
  491. [1208728800000, 117.48],
  492. [1208815200000, 118.30],
  493. [1208988000000, 116.06],
  494. [1209074400000, 118.52],
  495. [1209333600000, 118.75],
  496. [1209420000000, 113.46],
  497. [1209592800000, 112.52],
  498. [1210024800000, 121.84],
  499. [1210111200000, 123.53],
  500. [1210197600000, 123.69],
  501. [1210543200000, 124.23],
  502. [1210629600000, 125.80],
  503. [1210716000000, 126.29],
  504. [1211148000000, 127.05],
  505. [1211320800000, 129.07],
  506. [1211493600000, 132.19],
  507. [1211839200000, 128.85],
  508. [1212357600000, 127.76],
  509. [1212703200000, 138.54],
  510. [1212962400000, 136.80],
  511. [1213135200000, 136.38],
  512. [1213308000000, 134.86],
  513. [1213653600000, 134.01],
  514. [1213740000000, 136.68],
  515. [1213912800000, 135.65],
  516. [1214172000000, 134.62],
  517. [1214258400000, 134.62],
  518. [1214344800000, 134.62],
  519. [1214431200000, 139.64],
  520. [1214517600000, 140.21],
  521. [1214776800000, 140.00],
  522. [1214863200000, 140.97],
  523. [1214949600000, 143.57],
  524. [1215036000000, 145.29],
  525. [1215381600000, 141.37],
  526. [1215468000000, 136.04],
  527. [1215727200000, 146.40],
  528. [1215986400000, 145.18],
  529. [1216072800000, 138.74],
  530. [1216159200000, 134.60],
  531. [1216245600000, 129.29],
  532. [1216332000000, 130.65],
  533. [1216677600000, 127.95],
  534. [1216850400000, 127.95],
  535. [1217282400000, 122.19],
  536. [1217455200000, 124.08],
  537. [1217541600000, 125.10],
  538. [1217800800000, 121.41],
  539. [1217887200000, 119.17],
  540. [1217973600000, 118.58],
  541. [1218060000000, 120.02],
  542. [1218405600000, 114.45],
  543. [1218492000000, 113.01],
  544. [1218578400000, 116.00],
  545. [1218751200000, 113.77],
  546. [1219010400000, 112.87],
  547. [1219096800000, 114.53],
  548. [1219269600000, 114.98],
  549. [1219356000000, 114.98],
  550. [1219701600000, 116.27],
  551. [1219788000000, 118.15],
  552. [1219874400000, 115.59],
  553. [1219960800000, 115.46],
  554. [1220306400000, 109.71],
  555. [1220392800000, 109.35],
  556. [1220565600000, 106.23],
  557. [1220824800000, 106.34]
  558. ];
  559. var exchangerates = [
  560. [1167606000000, 0.7580],
  561. [1167692400000, 0.7580],
  562. [1167778800000, 0.75470],
  563. [1167865200000, 0.75490],
  564. [1167951600000, 0.76130],
  565. [1168038000000, 0.76550],
  566. [1168124400000, 0.76930],
  567. [1168210800000, 0.76940],
  568. [1168297200000, 0.76880],
  569. [1168383600000, 0.76780],
  570. [1168470000000, 0.77080],
  571. [1168556400000, 0.77270],
  572. [1168642800000, 0.77490],
  573. [1168729200000, 0.77410],
  574. [1168815600000, 0.77410],
  575. [1168902000000, 0.77320],
  576. [1168988400000, 0.77270],
  577. [1169074800000, 0.77370],
  578. [1169161200000, 0.77240],
  579. [1169247600000, 0.77120],
  580. [1169334000000, 0.7720],
  581. [1169420400000, 0.77210],
  582. [1169506800000, 0.77170],
  583. [1169593200000, 0.77040],
  584. [1169679600000, 0.7690],
  585. [1169766000000, 0.77110],
  586. [1169852400000, 0.7740],
  587. [1169938800000, 0.77450],
  588. [1170025200000, 0.77450],
  589. [1170111600000, 0.7740],
  590. [1170198000000, 0.77160],
  591. [1170284400000, 0.77130],
  592. [1170370800000, 0.76780],
  593. [1170457200000, 0.76880],
  594. [1170543600000, 0.77180],
  595. [1170630000000, 0.77180],
  596. [1170716400000, 0.77280],
  597. [1170802800000, 0.77290],
  598. [1170889200000, 0.76980],
  599. [1170975600000, 0.76850],
  600. [1171062000000, 0.76810],
  601. [1171148400000, 0.7690],
  602. [1171234800000, 0.7690],
  603. [1171321200000, 0.76980],
  604. [1171407600000, 0.76990],
  605. [1171494000000, 0.76510],
  606. [1171580400000, 0.76130],
  607. [1171666800000, 0.76160],
  608. [1171753200000, 0.76140],
  609. [1171839600000, 0.76140],
  610. [1171926000000, 0.76070],
  611. [1172012400000, 0.76020],
  612. [1172098800000, 0.76110],
  613. [1172185200000, 0.76220],
  614. [1172271600000, 0.76150],
  615. [1172358000000, 0.75980],
  616. [1172444400000, 0.75980],
  617. [1172530800000, 0.75920],
  618. [1172617200000, 0.75730],
  619. [1172703600000, 0.75660],
  620. [1172790000000, 0.75670],
  621. [1172876400000, 0.75910],
  622. [1172962800000, 0.75820],
  623. [1173049200000, 0.75850],
  624. [1173135600000, 0.76130],
  625. [1173222000000, 0.76310],
  626. [1173308400000, 0.76150],
  627. [1173394800000, 0.760],
  628. [1173481200000, 0.76130],
  629. [1173567600000, 0.76270],
  630. [1173654000000, 0.76270],
  631. [1173740400000, 0.76080],
  632. [1173826800000, 0.75830],
  633. [1173913200000, 0.75750],
  634. [1173999600000, 0.75620],
  635. [1174086000000, 0.7520],
  636. [1174172400000, 0.75120],
  637. [1174258800000, 0.75120],
  638. [1174345200000, 0.75170],
  639. [1174431600000, 0.7520],
  640. [1174518000000, 0.75110],
  641. [1174604400000, 0.7480],
  642. [1174690800000, 0.75090],
  643. [1174777200000, 0.75310],
  644. [1174860000000, 0.75310],
  645. [1174946400000, 0.75270],
  646. [1175032800000, 0.74980],
  647. [1175119200000, 0.74930],
  648. [1175205600000, 0.75040],
  649. [1175292000000, 0.750],
  650. [1175378400000, 0.74910],
  651. [1175464800000, 0.74910],
  652. [1175551200000, 0.74850],
  653. [1175637600000, 0.74840],
  654. [1175724000000, 0.74920],
  655. [1175810400000, 0.74710],
  656. [1175896800000, 0.74590],
  657. [1175983200000, 0.74770],
  658. [1176069600000, 0.74770],
  659. [1176156000000, 0.74830],
  660. [1176242400000, 0.74580],
  661. [1176328800000, 0.74480],
  662. [1176415200000, 0.7430],
  663. [1176501600000, 0.73990],
  664. [1176588000000, 0.73950],
  665. [1176674400000, 0.73950],
  666. [1176760800000, 0.73780],
  667. [1176847200000, 0.73820],
  668. [1176933600000, 0.73620],
  669. [1177020000000, 0.73550],
  670. [1177106400000, 0.73480],
  671. [1177192800000, 0.73610],
  672. [1177279200000, 0.73610],
  673. [1177365600000, 0.73650],
  674. [1177452000000, 0.73620],
  675. [1177538400000, 0.73310],
  676. [1177624800000, 0.73390],
  677. [1177711200000, 0.73440],
  678. [1177797600000, 0.73270],
  679. [1177884000000, 0.73270],
  680. [1177970400000, 0.73360],
  681. [1178056800000, 0.73330],
  682. [1178143200000, 0.73590],
  683. [1178229600000, 0.73590],
  684. [1178316000000, 0.73720],
  685. [1178402400000, 0.7360],
  686. [1178488800000, 0.7360],
  687. [1178575200000, 0.7350],
  688. [1178661600000, 0.73650],
  689. [1178748000000, 0.73840],
  690. [1178834400000, 0.73950],
  691. [1178920800000, 0.74130],
  692. [1179007200000, 0.73970],
  693. [1179093600000, 0.73960],
  694. [1179180000000, 0.73850],
  695. [1179266400000, 0.73780],
  696. [1179352800000, 0.73660],
  697. [1179439200000, 0.740],
  698. [1179525600000, 0.74110],
  699. [1179612000000, 0.74060],
  700. [1179698400000, 0.74050],
  701. [1179784800000, 0.74140],
  702. [1179871200000, 0.74310],
  703. [1179957600000, 0.74310],
  704. [1180044000000, 0.74380],
  705. [1180130400000, 0.74430],
  706. [1180216800000, 0.74430],
  707. [1180303200000, 0.74430],
  708. [1180389600000, 0.74340],
  709. [1180476000000, 0.74290],
  710. [1180562400000, 0.74420],
  711. [1180648800000, 0.7440],
  712. [1180735200000, 0.74390],
  713. [1180821600000, 0.74370],
  714. [1180908000000, 0.74370],
  715. [1180994400000, 0.74290],
  716. [1181080800000, 0.74030],
  717. [1181167200000, 0.73990],
  718. [1181253600000, 0.74180],
  719. [1181340000000, 0.74680],
  720. [1181426400000, 0.7480],
  721. [1181512800000, 0.7480],
  722. [1181599200000, 0.7490],
  723. [1181685600000, 0.74940],
  724. [1181772000000, 0.75220],
  725. [1181858400000, 0.75150],
  726. [1181944800000, 0.75020],
  727. [1182031200000, 0.74720],
  728. [1182117600000, 0.74720],
  729. [1182204000000, 0.74620],
  730. [1182290400000, 0.74550],
  731. [1182376800000, 0.74490],
  732. [1182463200000, 0.74670],
  733. [1182549600000, 0.74580],
  734. [1182636000000, 0.74270],
  735. [1182722400000, 0.74270],
  736. [1182808800000, 0.7430],
  737. [1182895200000, 0.74290],
  738. [1182981600000, 0.7440],
  739. [1183068000000, 0.7430],
  740. [1183154400000, 0.74220],
  741. [1183240800000, 0.73880],
  742. [1183327200000, 0.73880],
  743. [1183413600000, 0.73690],
  744. [1183500000000, 0.73450],
  745. [1183586400000, 0.73450],
  746. [1183672800000, 0.73450],
  747. [1183759200000, 0.73520],
  748. [1183845600000, 0.73410],
  749. [1183932000000, 0.73410],
  750. [1184018400000, 0.7340],
  751. [1184104800000, 0.73240],
  752. [1184191200000, 0.72720],
  753. [1184277600000, 0.72640],
  754. [1184364000000, 0.72550],
  755. [1184450400000, 0.72580],
  756. [1184536800000, 0.72580],
  757. [1184623200000, 0.72560],
  758. [1184709600000, 0.72570],
  759. [1184796000000, 0.72470],
  760. [1184882400000, 0.72430],
  761. [1184968800000, 0.72440],
  762. [1185055200000, 0.72350],
  763. [1185141600000, 0.72350],
  764. [1185228000000, 0.72350],
  765. [1185314400000, 0.72350],
  766. [1185400800000, 0.72620],
  767. [1185487200000, 0.72880],
  768. [1185573600000, 0.73010],
  769. [1185660000000, 0.73370],
  770. [1185746400000, 0.73370],
  771. [1185832800000, 0.73240],
  772. [1185919200000, 0.72970],
  773. [1186005600000, 0.73170],
  774. [1186092000000, 0.73150],
  775. [1186178400000, 0.72880],
  776. [1186264800000, 0.72630],
  777. [1186351200000, 0.72630],
  778. [1186437600000, 0.72420],
  779. [1186524000000, 0.72530],
  780. [1186610400000, 0.72640],
  781. [1186696800000, 0.7270],
  782. [1186783200000, 0.73120],
  783. [1186869600000, 0.73050],
  784. [1186956000000, 0.73050],
  785. [1187042400000, 0.73180],
  786. [1187128800000, 0.73580],
  787. [1187215200000, 0.74090],
  788. [1187301600000, 0.74540],
  789. [1187388000000, 0.74370],
  790. [1187474400000, 0.74240],
  791. [1187560800000, 0.74240],
  792. [1187647200000, 0.74150],
  793. [1187733600000, 0.74190],
  794. [1187820000000, 0.74140],
  795. [1187906400000, 0.73770],
  796. [1187992800000, 0.73550],
  797. [1188079200000, 0.73150],
  798. [1188165600000, 0.73150],
  799. [1188252000000, 0.7320],
  800. [1188338400000, 0.73320],
  801. [1188424800000, 0.73460],
  802. [1188511200000, 0.73280],
  803. [1188597600000, 0.73230],
  804. [1188684000000, 0.7340],
  805. [1188770400000, 0.7340],
  806. [1188856800000, 0.73360],
  807. [1188943200000, 0.73510],
  808. [1189029600000, 0.73460],
  809. [1189116000000, 0.73210],
  810. [1189202400000, 0.72940],
  811. [1189288800000, 0.72660],
  812. [1189375200000, 0.72660],
  813. [1189461600000, 0.72540],
  814. [1189548000000, 0.72420],
  815. [1189634400000, 0.72130],
  816. [1189720800000, 0.71970],
  817. [1189807200000, 0.72090],
  818. [1189893600000, 0.7210],
  819. [1189980000000, 0.7210],
  820. [1190066400000, 0.7210],
  821. [1190152800000, 0.72090],
  822. [1190239200000, 0.71590],
  823. [1190325600000, 0.71330],
  824. [1190412000000, 0.71050],
  825. [1190498400000, 0.70990],
  826. [1190584800000, 0.70990],
  827. [1190671200000, 0.70930],
  828. [1190757600000, 0.70930],
  829. [1190844000000, 0.70760],
  830. [1190930400000, 0.7070],
  831. [1191016800000, 0.70490],
  832. [1191103200000, 0.70120],
  833. [1191189600000, 0.70110],
  834. [1191276000000, 0.70190],
  835. [1191362400000, 0.70460],
  836. [1191448800000, 0.70630],
  837. [1191535200000, 0.70890],
  838. [1191621600000, 0.70770],
  839. [1191708000000, 0.70770],
  840. [1191794400000, 0.70770],
  841. [1191880800000, 0.70910],
  842. [1191967200000, 0.71180],
  843. [1192053600000, 0.70790],
  844. [1192140000000, 0.70530],
  845. [1192226400000, 0.7050],
  846. [1192312800000, 0.70550],
  847. [1192399200000, 0.70550],
  848. [1192485600000, 0.70450],
  849. [1192572000000, 0.70510],
  850. [1192658400000, 0.70510],
  851. [1192744800000, 0.70170],
  852. [1192831200000, 0.70],
  853. [1192917600000, 0.69950],
  854. [1193004000000, 0.69940],
  855. [1193090400000, 0.70140],
  856. [1193176800000, 0.70360],
  857. [1193263200000, 0.70210],
  858. [1193349600000, 0.70020],
  859. [1193436000000, 0.69670],
  860. [1193522400000, 0.6950],
  861. [1193612400000, 0.6950],
  862. [1193698800000, 0.69390],
  863. [1193785200000, 0.6940],
  864. [1193871600000, 0.69220],
  865. [1193958000000, 0.69190],
  866. [1194044400000, 0.69140],
  867. [1194130800000, 0.68940],
  868. [1194217200000, 0.68910],
  869. [1194303600000, 0.69040],
  870. [1194390000000, 0.6890],
  871. [1194476400000, 0.68340],
  872. [1194562800000, 0.68230],
  873. [1194649200000, 0.68070],
  874. [1194735600000, 0.68150],
  875. [1194822000000, 0.68150],
  876. [1194908400000, 0.68470],
  877. [1194994800000, 0.68590],
  878. [1195081200000, 0.68220],
  879. [1195167600000, 0.68270],
  880. [1195254000000, 0.68370],
  881. [1195340400000, 0.68230],
  882. [1195426800000, 0.68220],
  883. [1195513200000, 0.68220],
  884. [1195599600000, 0.67920],
  885. [1195686000000, 0.67460],
  886. [1195772400000, 0.67350],
  887. [1195858800000, 0.67310],
  888. [1195945200000, 0.67420],
  889. [1196031600000, 0.67440],
  890. [1196118000000, 0.67390],
  891. [1196204400000, 0.67310],
  892. [1196290800000, 0.67610],
  893. [1196377200000, 0.67610],
  894. [1196463600000, 0.67850],
  895. [1196550000000, 0.68180],
  896. [1196636400000, 0.68360],
  897. [1196722800000, 0.68230],
  898. [1196809200000, 0.68050],
  899. [1196895600000, 0.67930],
  900. [1196982000000, 0.68490],
  901. [1197068400000, 0.68330],
  902. [1197154800000, 0.68250],
  903. [1197241200000, 0.68250],
  904. [1197327600000, 0.68160],
  905. [1197414000000, 0.67990],
  906. [1197500400000, 0.68130],
  907. [1197586800000, 0.68090],
  908. [1197673200000, 0.68680],
  909. [1197759600000, 0.69330],
  910. [1197846000000, 0.69330],
  911. [1197932400000, 0.69450],
  912. [1198018800000, 0.69440],
  913. [1198105200000, 0.69460],
  914. [1198191600000, 0.69640],
  915. [1198278000000, 0.69650],
  916. [1198364400000, 0.69560],
  917. [1198450800000, 0.69560],
  918. [1198537200000, 0.6950],
  919. [1198623600000, 0.69480],
  920. [1198710000000, 0.69280],
  921. [1198796400000, 0.68870],
  922. [1198882800000, 0.68240],
  923. [1198969200000, 0.67940],
  924. [1199055600000, 0.67940],
  925. [1199142000000, 0.68030],
  926. [1199228400000, 0.68550],
  927. [1199314800000, 0.68240],
  928. [1199401200000, 0.67910],
  929. [1199487600000, 0.67830],
  930. [1199574000000, 0.67850],
  931. [1199660400000, 0.67850],
  932. [1199746800000, 0.67970],
  933. [1199833200000, 0.680],
  934. [1199919600000, 0.68030],
  935. [1200006000000, 0.68050],
  936. [1200092400000, 0.6760],
  937. [1200178800000, 0.6770],
  938. [1200265200000, 0.6770],
  939. [1200351600000, 0.67360],
  940. [1200438000000, 0.67260],
  941. [1200524400000, 0.67640],
  942. [1200610800000, 0.68210],
  943. [1200697200000, 0.68310],
  944. [1200783600000, 0.68420],
  945. [1200870000000, 0.68420],
  946. [1200956400000, 0.68870],
  947. [1201042800000, 0.69030],
  948. [1201129200000, 0.68480],
  949. [1201215600000, 0.68240],
  950. [1201302000000, 0.67880],
  951. [1201388400000, 0.68140],
  952. [1201474800000, 0.68140],
  953. [1201561200000, 0.67970],
  954. [1201647600000, 0.67690],
  955. [1201734000000, 0.67650],
  956. [1201820400000, 0.67330],
  957. [1201906800000, 0.67290],
  958. [1201993200000, 0.67580],
  959. [1202079600000, 0.67580],
  960. [1202166000000, 0.6750],
  961. [1202252400000, 0.6780],
  962. [1202338800000, 0.68330],
  963. [1202425200000, 0.68560],
  964. [1202511600000, 0.69030],
  965. [1202598000000, 0.68960],
  966. [1202684400000, 0.68960],
  967. [1202770800000, 0.68820],
  968. [1202857200000, 0.68790],
  969. [1202943600000, 0.68620],
  970. [1203030000000, 0.68520],
  971. [1203116400000, 0.68230],
  972. [1203202800000, 0.68130],
  973. [1203289200000, 0.68130],
  974. [1203375600000, 0.68220],
  975. [1203462000000, 0.68020],
  976. [1203548400000, 0.68020],
  977. [1203634800000, 0.67840],
  978. [1203721200000, 0.67480],
  979. [1203807600000, 0.67470],
  980. [1203894000000, 0.67470],
  981. [1203980400000, 0.67480],
  982. [1204066800000, 0.67330],
  983. [1204153200000, 0.6650],
  984. [1204239600000, 0.66110],
  985. [1204326000000, 0.65830],
  986. [1204412400000, 0.6590],
  987. [1204498800000, 0.6590],
  988. [1204585200000, 0.65810],
  989. [1204671600000, 0.65780],
  990. [1204758000000, 0.65740],
  991. [1204844400000, 0.65320],
  992. [1204930800000, 0.65020],
  993. [1205017200000, 0.65140],
  994. [1205103600000, 0.65140],
  995. [1205190000000, 0.65070],
  996. [1205276400000, 0.6510],
  997. [1205362800000, 0.64890],
  998. [1205449200000, 0.64240],
  999. [1205535600000, 0.64060],
  1000. [1205622000000, 0.63820],
  1001. [1205708400000, 0.63820],
  1002. [1205794800000, 0.63410],
  1003. [1205881200000, 0.63440],
  1004. [1205967600000, 0.63780],
  1005. [1206054000000, 0.64390],
  1006. [1206140400000, 0.64780],
  1007. [1206226800000, 0.64810],
  1008. [1206313200000, 0.64810],
  1009. [1206399600000, 0.64940],
  1010. [1206486000000, 0.64380],
  1011. [1206572400000, 0.63770],
  1012. [1206658800000, 0.63290],
  1013. [1206745200000, 0.63360],
  1014. [1206831600000, 0.63330],
  1015. [1206914400000, 0.63330],
  1016. [1207000800000, 0.6330],
  1017. [1207087200000, 0.63710],
  1018. [1207173600000, 0.64030],
  1019. [1207260000000, 0.63960],
  1020. [1207346400000, 0.63640],
  1021. [1207432800000, 0.63560],
  1022. [1207519200000, 0.63560],
  1023. [1207605600000, 0.63680],
  1024. [1207692000000, 0.63570],
  1025. [1207778400000, 0.63540],
  1026. [1207864800000, 0.6320],
  1027. [1207951200000, 0.63320],
  1028. [1208037600000, 0.63280],
  1029. [1208124000000, 0.63310],
  1030. [1208210400000, 0.63420],
  1031. [1208296800000, 0.63210],
  1032. [1208383200000, 0.63020],
  1033. [1208469600000, 0.62780],
  1034. [1208556000000, 0.63080],
  1035. [1208642400000, 0.63240],
  1036. [1208728800000, 0.63240],
  1037. [1208815200000, 0.63070],
  1038. [1208901600000, 0.62770],
  1039. [1208988000000, 0.62690],
  1040. [1209074400000, 0.63350],
  1041. [1209160800000, 0.63920],
  1042. [1209247200000, 0.640],
  1043. [1209333600000, 0.64010],
  1044. [1209420000000, 0.63960],
  1045. [1209506400000, 0.64070],
  1046. [1209592800000, 0.64230],
  1047. [1209679200000, 0.64290],
  1048. [1209765600000, 0.64720],
  1049. [1209852000000, 0.64850],
  1050. [1209938400000, 0.64860],
  1051. [1210024800000, 0.64670],
  1052. [1210111200000, 0.64440],
  1053. [1210197600000, 0.64670],
  1054. [1210284000000, 0.65090],
  1055. [1210370400000, 0.64780],
  1056. [1210456800000, 0.64610],
  1057. [1210543200000, 0.64610],
  1058. [1210629600000, 0.64680],
  1059. [1210716000000, 0.64490],
  1060. [1210802400000, 0.6470],
  1061. [1210888800000, 0.64610],
  1062. [1210975200000, 0.64520],
  1063. [1211061600000, 0.64220],
  1064. [1211148000000, 0.64220],
  1065. [1211234400000, 0.64250],
  1066. [1211320800000, 0.64140],
  1067. [1211407200000, 0.63660],
  1068. [1211493600000, 0.63460],
  1069. [1211580000000, 0.6350],
  1070. [1211666400000, 0.63460],
  1071. [1211752800000, 0.63460],
  1072. [1211839200000, 0.63430],
  1073. [1211925600000, 0.63460],
  1074. [1212012000000, 0.63790],
  1075. [1212098400000, 0.64160],
  1076. [1212184800000, 0.64420],
  1077. [1212271200000, 0.64310],
  1078. [1212357600000, 0.64310],
  1079. [1212444000000, 0.64350],
  1080. [1212530400000, 0.6440],
  1081. [1212616800000, 0.64730],
  1082. [1212703200000, 0.64690],
  1083. [1212789600000, 0.63860],
  1084. [1212876000000, 0.63560],
  1085. [1212962400000, 0.6340],
  1086. [1213048800000, 0.63460],
  1087. [1213135200000, 0.6430],
  1088. [1213221600000, 0.64520],
  1089. [1213308000000, 0.64670],
  1090. [1213394400000, 0.65060],
  1091. [1213480800000, 0.65040],
  1092. [1213567200000, 0.65030],
  1093. [1213653600000, 0.64810],
  1094. [1213740000000, 0.64510],
  1095. [1213826400000, 0.6450],
  1096. [1213912800000, 0.64410],
  1097. [1213999200000, 0.64140],
  1098. [1214085600000, 0.64090],
  1099. [1214172000000, 0.64090],
  1100. [1214258400000, 0.64280],
  1101. [1214344800000, 0.64310],
  1102. [1214431200000, 0.64180],
  1103. [1214517600000, 0.63710],
  1104. [1214604000000, 0.63490],
  1105. [1214690400000, 0.63330],
  1106. [1214776800000, 0.63340],
  1107. [1214863200000, 0.63380],
  1108. [1214949600000, 0.63420],
  1109. [1215036000000, 0.6320],
  1110. [1215122400000, 0.63180],
  1111. [1215208800000, 0.6370],
  1112. [1215295200000, 0.63680],
  1113. [1215381600000, 0.63680],
  1114. [1215468000000, 0.63830],
  1115. [1215554400000, 0.63710],
  1116. [1215640800000, 0.63710],
  1117. [1215727200000, 0.63550],
  1118. [1215813600000, 0.6320],
  1119. [1215900000000, 0.62770],
  1120. [1215986400000, 0.62760],
  1121. [1216072800000, 0.62910],
  1122. [1216159200000, 0.62740],
  1123. [1216245600000, 0.62930],
  1124. [1216332000000, 0.63110],
  1125. [1216418400000, 0.6310],
  1126. [1216504800000, 0.63120],
  1127. [1216591200000, 0.63120],
  1128. [1216677600000, 0.63040],
  1129. [1216764000000, 0.62940],
  1130. [1216850400000, 0.63480],
  1131. [1216936800000, 0.63780],
  1132. [1217023200000, 0.63680],
  1133. [1217109600000, 0.63680],
  1134. [1217196000000, 0.63680],
  1135. [1217282400000, 0.6360],
  1136. [1217368800000, 0.6370],
  1137. [1217455200000, 0.64180],
  1138. [1217541600000, 0.64110],
  1139. [1217628000000, 0.64350],
  1140. [1217714400000, 0.64270],
  1141. [1217800800000, 0.64270],
  1142. [1217887200000, 0.64190],
  1143. [1217973600000, 0.64460],
  1144. [1218060000000, 0.64680],
  1145. [1218146400000, 0.64870],
  1146. [1218232800000, 0.65940],
  1147. [1218319200000, 0.66660],
  1148. [1218405600000, 0.66660],
  1149. [1218492000000, 0.66780],
  1150. [1218578400000, 0.67120],
  1151. [1218664800000, 0.67050],
  1152. [1218751200000, 0.67180],
  1153. [1218837600000, 0.67840],
  1154. [1218924000000, 0.68110],
  1155. [1219010400000, 0.68110],
  1156. [1219096800000, 0.67940],
  1157. [1219183200000, 0.68040],
  1158. [1219269600000, 0.67810],
  1159. [1219356000000, 0.67560],
  1160. [1219442400000, 0.67350],
  1161. [1219528800000, 0.67630],
  1162. [1219615200000, 0.67620],
  1163. [1219701600000, 0.67770],
  1164. [1219788000000, 0.68150],
  1165. [1219874400000, 0.68020],
  1166. [1219960800000, 0.6780],
  1167. [1220047200000, 0.67960],
  1168. [1220133600000, 0.68170],
  1169. [1220220000000, 0.68170],
  1170. [1220306400000, 0.68320],
  1171. [1220392800000, 0.68770],
  1172. [1220479200000, 0.69120],
  1173. [1220565600000, 0.69140],
  1174. [1220652000000, 0.70090],
  1175. [1220738400000, 0.70120],
  1176. [1220824800000, 0.7010],
  1177. [1220911200000, 0.70050]
  1178. ];
  1179. function euroFormatter(v, axis) {
  1180. return "&yen;"+v.toFixed(axis.tickDecimals);
  1181. }
  1182. function doPlot(position) {
  1183. $.plot($("#flot-line-chart-multi"), [{
  1184. data: oilprices,
  1185. label: "油价 (&yen;)"
  1186. }, {
  1187. data: exchangerates,
  1188. label: "美元/人民币汇率",
  1189. yaxis: 2
  1190. }], {
  1191. xaxes: [{
  1192. mode: 'time'
  1193. }],
  1194. yaxes: [{
  1195. min: 0
  1196. }, {
  1197. // align if we are to the right
  1198. alignTicksWithAxis: position == "right" ? 1 : null,
  1199. position: position,
  1200. tickFormatter: euroFormatter
  1201. }],
  1202. legend: {
  1203. position: 'sw'
  1204. },
  1205. colors: ["#1ab394"],
  1206. grid: {
  1207. color: "#999999",
  1208. hoverable: true,
  1209. clickable: true,
  1210. tickColor: "#D4D4D4",
  1211. borderWidth:0,
  1212. hoverable: true //IMPORTANT! this is needed for tooltip to work,
  1213. },
  1214. tooltip: true,
  1215. tooltipOpts: {
  1216. content: "%s %x 为 %y",
  1217. xDateFormat: "%y-%0m-%0d",
  1218. onHover: function(flotItem, $tooltipEl) {
  1219. // console.log(flotItem, $tooltipEl);
  1220. }
  1221. }
  1222. });
  1223. }
  1224. doPlot("right");
  1225. $("button").click(function() {
  1226. doPlot($(this).text());
  1227. });
  1228. });