• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <style>
    8. * {
    9. font-family: 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans';
    10. font-size: 12px;
    11. }
    12. </style>
    13.  
    14. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    15. <style>
    16. html,
    17. body {
    18. height: 100%;
    19. width: 100%;
    20. margin: 0;
    21. padding: 0;
    22. }
    23.  
    24. #myChart {
    25. height: 100%;
    26. width: 100%;
    27. min-height: 150px;
    28. }
    29.  
    30. .zc-ref {
    31. display: none;
    32. }
    33. </style>
    34. </head>
    35.  
    36. <body>
    37. <div id="myChart"></div>
    38. <script>
    39. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    40. let chartConfig = {
    41. type: 'depth',
    42. backgroundColor: '#f3f3f3 #d9d9d9',
    43. options: {
    44. buttonZoomin: {
    45. borderColor: 'red',
    46. borderWidth: 4,
    47. hoverState: {
    48. backgroundColor: 'red',
    49. },
    50. mediaRules: [{
    51. maxWidth: 400,
    52. backgroundColor: 'pink',
    53. }],
    54. tooltip: {
    55. backgroundColor: 'red'
    56. },
    57. },
    58. buttonZoomout: {
    59. borderColor: 'red',
    60. borderWidth: 4,
    61. hoverState: {
    62. backgroundColor: 'red',
    63. },
    64. mediaRules: [{
    65. maxWidth: 400,
    66. backgroundColor: 'pink',
    67. }],
    68. tooltip: {
    69. backgroundColor: 'red'
    70. },
    71. },
    72. currency: '$',
    73. mmpMarker: {
    74. lineColor: 'blue',
    75. lineWidth: 5,
    76. label: {
    77. backgroundColor: 'green',
    78.  
    79. topState: {
    80. backgroundColor: 'red',
    81. offsetX: 10,
    82. offsetY: 10,
    83. }
    84. },
    85. },
    86. subtitle: {
    87. text: 'Subtitle'
    88. },
    89. title: {
    90. text: 'Title'
    91. },
    92. },
    93. series: [{
    94. values: [
    95. [1168.49, 0],
    96. [1164.69, 12.0211],
    97. [1163.38, 33.0049],
    98. [1160.98, 45.5622],
    99. [1158.64, 60.4819],
    100. [1154.04, 71.5594],
    101. [1146.54, 83.2051],
    102. [1133.37, 106.8834],
    103. [1129.63, 127.1219],
    104. [1126.89, 145.2484],
    105. [1115.14, 155.8074],
    106. [1113.54, 171.8438],
    107. [1110.49, 184.443],
    108. [1106.92, 202.3068],
    109. [1106.7, 224.5185],
    110. [1104.03, 244.5286],
    111. [1101.99, 256.5801],
    112. [1099.57, 272.8992],
    113. [1099.47, 289.2549],
    114. [1095.76, 300.107],
    115. [1091.75, 320.0837],
    116. [1091.37, 334.7523],
    117. [1086.9, 357.9836],
    118. [1086.6, 375.3844],
    119. [1081.13, 387.3668],
    120. [1079.3, 403.3796],
    121. [1074.56, 420.0898],
    122. [1069.69, 438.8176],
    123. [1068.59, 462.0495],
    124. [1056.35, 484.2044],
    125. [1052.93, 507.0559],
    126. [1052.03, 529.1966],
    127. [1047.46, 541.6345],
    128. [1033.06, 551.942],
    129. [1030.42, 569.7072],
    130. [1025.65, 583.7136],
    131. [1023.38, 608.1764],
    132. [1020.04, 620.0944],
    133. [1018.53, 644.661],
    134. [1014.92, 661.6777]
    135. ],
    136. text: 'Sell'
    137. },
    138. {
    139. values: [
    140. [1168.49, 0],
    141. [1172.22, 33.1932],
    142. [1174.28, 50.5177],
    143. [1174.99, 81.8346],
    144. [1189.53, 104.332],
    145. [1191.07, 119.9178],
    146. [1195.62, 146.3812],
    147. [1199.32, 180.9109],
    148. [1201.89, 199.313],
    149. [1204.34, 228.9945],
    150. [1206.47, 251.6454],
    151. [1209.44, 285.6366],
    152. [1221.89, 312.7949],
    153. [1230.48, 328.6889],
    154. [1235.24, 351.3438],
    155. [1248.33, 377.9289],
    156. [1251.24, 409.9444],
    157. [1253.75, 435.5418],
    158. [1257.48, 453.8852],
    159. [1261.01, 483.8769],
    160. [1265.06, 499.7163],
    161. [1268.75, 529.6374],
    162. [1270.2, 552.1779],
    163. [1272.15, 579.5218],
    164. [1274.19, 606.4376],
    165. [1276.17, 638.8508],
    166. [1283.07, 668.7969],
    167. [1285.76, 694.1647],
    168. [1287.89, 709.9417],
    169. [1288.72, 735.6358],
    170. [1295.71, 765.2281],
    171. [1303.26, 784.6807],
    172. [1305.43, 801.1021],
    173. [1307.78, 817.4528],
    174. [1312.76, 836.7914],
    175. [1317.6, 859.4746],
    176. [1322.31, 891.443],
    177. [1324.35, 907.6098],
    178. [1325.7, 931.1996],
    179. [1528.01, 949.3013]
    180. ],
    181. text: 'Buy'
    182. }
    183. ]
    184. };
    185.  
    186. let chartConfig2 = {
    187. type: 'depth',
    188. backgroundColor: '#000',
    189. options: {
    190. currency: '\u20ac',
    191. title: {
    192. color: '#ff0'
    193. },
    194. subtitle: {
    195. visible: false
    196. },
    197. mmpMarker: {
    198. alpha: 0.75,
    199. lineColor: '#999',
    200. label: {
    201. color: '#fff',
    202. fontSize: 15,
    203. offsetY: 20
    204. }
    205. },
    206. palette: ['#909', '#990'],
    207. },
    208. scaleX: {
    209. item: {
    210. fontSize: 11,
    211. color: '#f90'
    212. }
    213. },
    214. scaleY: {
    215. item: {
    216. color: '#fff'
    217. }
    218. },
    219. scaleY2: {
    220. item: {
    221. color: '#fff'
    222. }
    223. },
    224. plot: {
    225. mode: 'normal'
    226. },
    227. crosshairX: {
    228. plotLabel: {
    229. color: '#fff',
    230. backgroundColor: '#000'
    231. }
    232. },
    233. series: [{
    234. values: [
    235. [83168.4942, 0],
    236. [83165.2911, 24.5257],
    237. [83162.4432, 41.831],
    238. [83155.7512, 55.5769],
    239. [83155.2945, 67.9671],
    240. [83151.4232, 78.4742],
    241. [83151.3712, 91.5577],
    242. [83150.8574, 104.5983],
    243. [83150.4721, 123.8432],
    244. [83149.6144, 147.7095],
    245. [83148.2683, 171.1301],
    246. [83147.3312, 190.1485],
    247. [83142.4782, 210.6557],
    248. [83139.2812, 228.9494],
    249. [83139.1911, 244.5898],
    250. [83134.4493, 258.1534],
    251. [83131.9837, 278.0654],
    252. [83131.6223, 302.7251],
    253. [83130.3352, 317.3595],
    254. [83122.9212, 333.889],
    255. [83118.0342, 352.3895],
    256. [83117.3329, 374.7495],
    257. [83105.0412, 388.6047],
    258. [83103.0253, 404.7422],
    259. [83098.6836, 426.4222],
    260. [83095.4497, 437.743],
    261. [83091.9221, 461.9394],
    262. [83087.6823, 474.8041],
    263. [83083.1435, 495.8427],
    264. [83080.8234, 513.83],
    265. [83078.3357, 535.1954],
    266. [83076.0832, 554.3064],
    267. [83073.8655, 572.399],
    268. [83071.9923, 587.107],
    269. [83068.2523, 606.2238],
    270. [83066.6343, 623.5779],
    271. [83059.5455, 642.0529],
    272. [83057.8222, 664.9309],
    273. [83057.7349, 677.6618],
    274. [83054.5993, 702.1566]
    275. ],
    276. text: 'Vendre'
    277. },
    278. {
    279. values: [
    280. [83168.4942, 0],
    281. [83173.5953, 29.0944],
    282. [83177.5155, 60.5268],
    283. [83178.2274, 94.9951],
    284. [83178.8583, 129.6222],
    285. [83190.3322, 155.1349],
    286. [83193.0553, 179.3527],
    287. [83196.3542, 205.565],
    288. [83197.8851, 227.5875],
    289. [83202.0866, 247.89],
    290. [83202.6833, 278.4508],
    291. [83204.7512, 311.6391],
    292. [83218.5123, 343.4197],
    293. [83218.5655, 378.3272],
    294. [83222.1664, 395.7356],
    295. [83226.3923, 418.799],
    296. [83230.4766, 446.4546],
    297. [83232.0442, 469.4259],
    298. [83245.1453, 490.0896],
    299. [83249.8511, 523.8051],
    300. [83256.5532, 546.2099],
    301. [83257.7456, 575.9132],
    302. [83259.8746, 593.3904],
    303. [83261.8122, 621.4962],
    304. [83266.4694, 640.2163],
    305. [83270.2922, 669.7849],
    306. [83271.7844, 692.9558],
    307. [83272.8266, 718.0753],
    308. [83277.1333, 751.864],
    309. [83280.1222, 779.7172],
    310. [83282.6788, 809.8779],
    311. [83285.2123, 826.0661],
    312. [83293.2132, 857.981],
    313. [83297.19, 884.2067],
    314. [83311.1421, 899.814],
    315. [83311.5344, 927.7719],
    316. [83314.5662, 954.9667],
    317. [83322.4794, 986.9748],
    318. [83322.8721, 1013.3939],
    319. [83323.0612, 1040.1686]
    320. ],
    321. text: 'Acheter'
    322. }
    323. ]
    324. };
    325.  
    326. let chartupdate = function(c) {
    327.  
    328. // generate random data
    329. if (c === 0) {
    330. let fMidMarketPrice = 1168.49 + (-50 + 100 * Math.random());
    331. } else {
    332. let fMidMarketPrice = 83168.49 + (-500 + 1000 * Math.random());
    333. }
    334.  
    335. let sells = [],
    336. buys = [],
    337. kref, vref, kstep, vstep, mul, vmax = 0;
    338.  
    339. kref = fMidMarketPrice;
    340. vref = 0;
    341. for (let s = 0; s < 100; s++) {
    342. vmax = Math.max(vmax, vref);
    343. sells.push([parseFloat(kref.toFixed(2)), parseFloat(vref.toFixed(4))]);
    344. mul = Math.random() < 0.25 ? 15 : 5;
    345. kstep = mul * Math.random();
    346. vstep = 10 + 15 * Math.random();
    347. kref -= kstep;
    348. vref += vstep;
    349. }
    350.  
    351. kref = fMidMarketPrice;
    352. vref = 0;
    353. for (let b = 0; b < 100; b++) {
    354. vmax = Math.max(vmax, vref);
    355. buys.push([parseFloat(kref.toFixed(2)), parseFloat(vref.toFixed(4))]);
    356. mul = Math.random() < 0.25 ? 15 : 5;
    357. kstep = mul * Math.random();
    358. vstep = 15 + 20 * Math.random();
    359. kref += kstep;
    360. vref += vstep;
    361. }
    362.  
    363. if (c === 0) {
    364. chartConfig['series'][0]['values'] = sells;
    365. chartConfig['series'][1]['values'] = buys;
    366. zingchart.exec('zc1', 'setdata', {
    367. data: chartConfig
    368. });
    369. } else {
    370. chartConfig2['series'][0]['values'] = sells;
    371. chartConfig2['series'][1]['values'] = buys;
    372. zingchart.exec('zc2', 'setdata', {
    373. data: chartConfig2
    374. });
    375. }
    376.  
    377. };
    378.  
    379.  
    380.  
    381. zingchart.render({
    382. id: 'myChart',
    383. data: chartConfig
    384. });
    385. </script>
    386. </body>
    387.  
    388. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <style>
    8. * {
    9. font-family: 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans';
    10. font-size: 12px;
    11. }
    12. </style>
    13.  
    14. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    15. </head>
    16.  
    17. <body>
    18. <div id="myChart"></div>
    19. </body>
    20.  
    21. </html>
    1. html,
    2. body {
    3. height: 100%;
    4. width: 100%;
    5. margin: 0;
    6. padding: 0;
    7. }
    8.  
    9. #myChart {
    10. height: 100%;
    11. width: 100%;
    12. min-height: 150px;
    13. }
    14.  
    15. .zc-ref {
    16. display: none;
    17. }
    1. let chartConfig = {
    2. type: 'depth',
    3. backgroundColor: '#f3f3f3 #d9d9d9',
    4. options: {
    5. buttonZoomin: {
    6. borderColor: 'red',
    7. borderWidth: 4,
    8. hoverState: {
    9. backgroundColor: 'red',
    10. },
    11. mediaRules: [{
    12. maxWidth: 400,
    13. backgroundColor: 'pink',
    14. }],
    15. tooltip: {
    16. backgroundColor: 'red'
    17. },
    18. },
    19. buttonZoomout: {
    20. borderColor: 'red',
    21. borderWidth: 4,
    22. hoverState: {
    23. backgroundColor: 'red',
    24. },
    25. mediaRules: [{
    26. maxWidth: 400,
    27. backgroundColor: 'pink',
    28. }],
    29. tooltip: {
    30. backgroundColor: 'red'
    31. },
    32. },
    33. currency: '$',
    34. mmpMarker: {
    35. lineColor: 'blue',
    36. lineWidth: 5,
    37. label: {
    38. backgroundColor: 'green',
    39.  
    40. topState: {
    41. backgroundColor: 'red',
    42. offsetX: 10,
    43. offsetY: 10,
    44. }
    45. },
    46. },
    47. subtitle: {
    48. text: 'Subtitle'
    49. },
    50. title: {
    51. text: 'Title'
    52. },
    53. },
    54. series: [{
    55. values: [
    56. [1168.49, 0],
    57. [1164.69, 12.0211],
    58. [1163.38, 33.0049],
    59. [1160.98, 45.5622],
    60. [1158.64, 60.4819],
    61. [1154.04, 71.5594],
    62. [1146.54, 83.2051],
    63. [1133.37, 106.8834],
    64. [1129.63, 127.1219],
    65. [1126.89, 145.2484],
    66. [1115.14, 155.8074],
    67. [1113.54, 171.8438],
    68. [1110.49, 184.443],
    69. [1106.92, 202.3068],
    70. [1106.7, 224.5185],
    71. [1104.03, 244.5286],
    72. [1101.99, 256.5801],
    73. [1099.57, 272.8992],
    74. [1099.47, 289.2549],
    75. [1095.76, 300.107],
    76. [1091.75, 320.0837],
    77. [1091.37, 334.7523],
    78. [1086.9, 357.9836],
    79. [1086.6, 375.3844],
    80. [1081.13, 387.3668],
    81. [1079.3, 403.3796],
    82. [1074.56, 420.0898],
    83. [1069.69, 438.8176],
    84. [1068.59, 462.0495],
    85. [1056.35, 484.2044],
    86. [1052.93, 507.0559],
    87. [1052.03, 529.1966],
    88. [1047.46, 541.6345],
    89. [1033.06, 551.942],
    90. [1030.42, 569.7072],
    91. [1025.65, 583.7136],
    92. [1023.38, 608.1764],
    93. [1020.04, 620.0944],
    94. [1018.53, 644.661],
    95. [1014.92, 661.6777]
    96. ],
    97. text: 'Sell'
    98. },
    99. {
    100. values: [
    101. [1168.49, 0],
    102. [1172.22, 33.1932],
    103. [1174.28, 50.5177],
    104. [1174.99, 81.8346],
    105. [1189.53, 104.332],
    106. [1191.07, 119.9178],
    107. [1195.62, 146.3812],
    108. [1199.32, 180.9109],
    109. [1201.89, 199.313],
    110. [1204.34, 228.9945],
    111. [1206.47, 251.6454],
    112. [1209.44, 285.6366],
    113. [1221.89, 312.7949],
    114. [1230.48, 328.6889],
    115. [1235.24, 351.3438],
    116. [1248.33, 377.9289],
    117. [1251.24, 409.9444],
    118. [1253.75, 435.5418],
    119. [1257.48, 453.8852],
    120. [1261.01, 483.8769],
    121. [1265.06, 499.7163],
    122. [1268.75, 529.6374],
    123. [1270.2, 552.1779],
    124. [1272.15, 579.5218],
    125. [1274.19, 606.4376],
    126. [1276.17, 638.8508],
    127. [1283.07, 668.7969],
    128. [1285.76, 694.1647],
    129. [1287.89, 709.9417],
    130. [1288.72, 735.6358],
    131. [1295.71, 765.2281],
    132. [1303.26, 784.6807],
    133. [1305.43, 801.1021],
    134. [1307.78, 817.4528],
    135. [1312.76, 836.7914],
    136. [1317.6, 859.4746],
    137. [1322.31, 891.443],
    138. [1324.35, 907.6098],
    139. [1325.7, 931.1996],
    140. [1528.01, 949.3013]
    141. ],
    142. text: 'Buy'
    143. }
    144. ]
    145. };
    146.  
    147. let chartConfig2 = {
    148. type: 'depth',
    149. backgroundColor: '#000',
    150. options: {
    151. currency: '\u20ac',
    152. title: {
    153. color: '#ff0'
    154. },
    155. subtitle: {
    156. visible: false
    157. },
    158. mmpMarker: {
    159. alpha: 0.75,
    160. lineColor: '#999',
    161. label: {
    162. color: '#fff',
    163. fontSize: 15,
    164. offsetY: 20
    165. }
    166. },
    167. palette: ['#909', '#990'],
    168. },
    169. scaleX: {
    170. item: {
    171. fontSize: 11,
    172. color: '#f90'
    173. }
    174. },
    175. scaleY: {
    176. item: {
    177. color: '#fff'
    178. }
    179. },
    180. scaleY2: {
    181. item: {
    182. color: '#fff'
    183. }
    184. },
    185. plot: {
    186. mode: 'normal'
    187. },
    188. crosshairX: {
    189. plotLabel: {
    190. color: '#fff',
    191. backgroundColor: '#000'
    192. }
    193. },
    194. series: [{
    195. values: [
    196. [83168.4942, 0],
    197. [83165.2911, 24.5257],
    198. [83162.4432, 41.831],
    199. [83155.7512, 55.5769],
    200. [83155.2945, 67.9671],
    201. [83151.4232, 78.4742],
    202. [83151.3712, 91.5577],
    203. [83150.8574, 104.5983],
    204. [83150.4721, 123.8432],
    205. [83149.6144, 147.7095],
    206. [83148.2683, 171.1301],
    207. [83147.3312, 190.1485],
    208. [83142.4782, 210.6557],
    209. [83139.2812, 228.9494],
    210. [83139.1911, 244.5898],
    211. [83134.4493, 258.1534],
    212. [83131.9837, 278.0654],
    213. [83131.6223, 302.7251],
    214. [83130.3352, 317.3595],
    215. [83122.9212, 333.889],
    216. [83118.0342, 352.3895],
    217. [83117.3329, 374.7495],
    218. [83105.0412, 388.6047],
    219. [83103.0253, 404.7422],
    220. [83098.6836, 426.4222],
    221. [83095.4497, 437.743],
    222. [83091.9221, 461.9394],
    223. [83087.6823, 474.8041],
    224. [83083.1435, 495.8427],
    225. [83080.8234, 513.83],
    226. [83078.3357, 535.1954],
    227. [83076.0832, 554.3064],
    228. [83073.8655, 572.399],
    229. [83071.9923, 587.107],
    230. [83068.2523, 606.2238],
    231. [83066.6343, 623.5779],
    232. [83059.5455, 642.0529],
    233. [83057.8222, 664.9309],
    234. [83057.7349, 677.6618],
    235. [83054.5993, 702.1566]
    236. ],
    237. text: 'Vendre'
    238. },
    239. {
    240. values: [
    241. [83168.4942, 0],
    242. [83173.5953, 29.0944],
    243. [83177.5155, 60.5268],
    244. [83178.2274, 94.9951],
    245. [83178.8583, 129.6222],
    246. [83190.3322, 155.1349],
    247. [83193.0553, 179.3527],
    248. [83196.3542, 205.565],
    249. [83197.8851, 227.5875],
    250. [83202.0866, 247.89],
    251. [83202.6833, 278.4508],
    252. [83204.7512, 311.6391],
    253. [83218.5123, 343.4197],
    254. [83218.5655, 378.3272],
    255. [83222.1664, 395.7356],
    256. [83226.3923, 418.799],
    257. [83230.4766, 446.4546],
    258. [83232.0442, 469.4259],
    259. [83245.1453, 490.0896],
    260. [83249.8511, 523.8051],
    261. [83256.5532, 546.2099],
    262. [83257.7456, 575.9132],
    263. [83259.8746, 593.3904],
    264. [83261.8122, 621.4962],
    265. [83266.4694, 640.2163],
    266. [83270.2922, 669.7849],
    267. [83271.7844, 692.9558],
    268. [83272.8266, 718.0753],
    269. [83277.1333, 751.864],
    270. [83280.1222, 779.7172],
    271. [83282.6788, 809.8779],
    272. [83285.2123, 826.0661],
    273. [83293.2132, 857.981],
    274. [83297.19, 884.2067],
    275. [83311.1421, 899.814],
    276. [83311.5344, 927.7719],
    277. [83314.5662, 954.9667],
    278. [83322.4794, 986.9748],
    279. [83322.8721, 1013.3939],
    280. [83323.0612, 1040.1686]
    281. ],
    282. text: 'Acheter'
    283. }
    284. ]
    285. };
    286.  
    287. let chartupdate = function(c) {
    288.  
    289. // generate random data
    290. if (c === 0) {
    291. let fMidMarketPrice = 1168.49 + (-50 + 100 * Math.random());
    292. } else {
    293. let fMidMarketPrice = 83168.49 + (-500 + 1000 * Math.random());
    294. }
    295.  
    296. let sells = [],
    297. buys = [],
    298. kref, vref, kstep, vstep, mul, vmax = 0;
    299.  
    300. kref = fMidMarketPrice;
    301. vref = 0;
    302. for (let s = 0; s < 100; s++) {
    303. vmax = Math.max(vmax, vref);
    304. sells.push([parseFloat(kref.toFixed(2)), parseFloat(vref.toFixed(4))]);
    305. mul = Math.random() < 0.25 ? 15 : 5;
    306. kstep = mul * Math.random();
    307. vstep = 10 + 15 * Math.random();
    308. kref -= kstep;
    309. vref += vstep;
    310. }
    311.  
    312. kref = fMidMarketPrice;
    313. vref = 0;
    314. for (let b = 0; b < 100; b++) {
    315. vmax = Math.max(vmax, vref);
    316. buys.push([parseFloat(kref.toFixed(2)), parseFloat(vref.toFixed(4))]);
    317. mul = Math.random() < 0.25 ? 15 : 5;
    318. kstep = mul * Math.random();
    319. vstep = 15 + 20 * Math.random();
    320. kref += kstep;
    321. vref += vstep;
    322. }
    323.  
    324. if (c === 0) {
    325. chartConfig['series'][0]['values'] = sells;
    326. chartConfig['series'][1]['values'] = buys;
    327. zingchart.exec('zc1', 'setdata', {
    328. data: chartConfig
    329. });
    330. } else {
    331. chartConfig2['series'][0]['values'] = sells;
    332. chartConfig2['series'][1]['values'] = buys;
    333. zingchart.exec('zc2', 'setdata', {
    334. data: chartConfig2
    335. });
    336. }
    337.  
    338. };
    339.  
    340.  
    341.  
    342. zingchart.render({
    343. id: 'myChart',
    344. data: chartConfig
    345. });