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