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