• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. <style></style>
    10. </head>
    11.  
    12. <body>
    13. <div id='myChart'></div>
    14. <script>
    15. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    16. var myConfig = {
    17. "type": "stock",
    18. "title": {
    19. "text": "Stock Chart with Preview Chart"
    20. },
    21. "plotarea": {
    22. "margin-bottom": "30%" //so the chart and preview don't squish together
    23. },
    24. "plot": {
    25. "aspect": "whisker",
    26. "tooltip": {
    27. "visible": false
    28. },
    29. "trend-up": {
    30. "line-color": "#00AAA0"
    31. },
    32. "trend-down": {
    33. "line-color": "#1E435D"
    34. },
    35. "preview": {
    36. "type": "area", //"area" (default) or "line"
    37. "line-color": "purple",
    38. "line-width": 1,
    39. "line-style": "dashdot",
    40. "background-color": "yellow", //one color only
    41. "alpha": 0.9,
    42. "alpha-area": 0.3
    43. }
    44. },
    45. "scale-x": {
    46. "min-value": 1420232400000,
    47. "step": "day",
    48. "transform": {
    49. "type": "date",
    50. "all": "%D,<br>%m/%d"
    51. },
    52. "max-items": 4,
    53. "zooming": true,
    54. "zoom-to-values": [1421787600000, 1426280400000]
    55. },
    56. "scale-y": {
    57. "values": "29:33:1",
    58. "format": "$%v",
    59. "guide": {
    60. "line-style": "solid"
    61. }
    62. },
    63. "preview": {
    64.  
    65. },
    66. "crosshair-x": {
    67. "plot-label": {
    68. "text": "Open: $%open<br>High: $%high<br>Low: $%low<br>Close: $%close",
    69. "decimals": 2
    70. },
    71. "scale-label": {
    72. "text": "%v" //seems to abide by "scale tokens", i.e., only %v works here.
    73. }
    74. },
    75. "series": [{
    76. "values": [
    77. [1420232400000, [31.34, 31.46, 30.87, 31.06]], //01/02/15
    78.  
    79. [1420491600000, [31.80, 32.25, 31.52, 32.05]], //01/05/15
    80. [1420578000000, [32.05, 32.57, 31.93, 32.30]], //01/06/15
    81. [1420664400000, [32.21, 32.39, 31.98, 32.08]], //01/07/15
    82. [1420750800000, [32.32, 32.38, 32.13, 32.37]], //01/08/15
    83. [1420837200000, [32.52, 32.53, 31.95, 32.03]], //01/09/15
    84.  
    85. [1421096400000, [32.07, 32.14, 31.77, 31.98]], //01/12/15
    86. [1421182800000, [32.26, 32.33, 31.61, 31.86]], //01/13/15
    87. [1421269200000, [31.65, 31.85, 31.41, 31.78]], //01/14/15
    88. [1421355600000, [31.86, 31.97, 31.56, 31.58]], //01/15/15
    89. [1421442000000, [31.51, 31.65, 31.45, 31.59]], //01/16/15
    90.  
    91. [1421787600000, [31.84, 31.87, 31.55, 31.85]], //01/20/15
    92. [1421874000000, [31.83, 32.08, 31.71, 32.04]], //01/21/15
    93. [1421960400000, [32.30, 32.36, 31.96, 32.28]], //01/22/15
    94. [1422046800000, [32.43, 32.88, 32.29, 32.48]], //01/23/15
    95.  
    96. [1422306000000, [32.72, 32.74, 32.40, 32.60]], //01/26/15
    97. [1422392400000, [32.39, 32.46, 32.20, 32.38]], //01/27/15
    98. [1422478800000, [32.47, 32.49, 31.81, 31.84]], //01/28/15
    99. [1422565200000, [31.84, 32.20, 31.78, 32.08]], //01/29/15
    100. [1422651600000, [31.88, 32.11, 31.82, 31.89]], //01/30/15
    101.  
    102. [1422910800000, [32.00, 32.22, 31.90, 32.21]], //02/02/15
    103. [1422997200000, [32.29, 32.52, 32.26, 32.47]], //02/03/15
    104. [1423083600000, [32.41, 32.43, 32.08, 32.16]], //02/04/15
    105. [1423170000000, [32.25, 32.50, 32.23, 32.50]], //02/05/15
    106. [1423256400000, [32.54, 32.75, 32.47, 32.52]], //02/06/15
    107.  
    108. [1423515600000, [32.47, 32.75, 31.50, 31.64]], //02/09/15
    109. [1423602000000, [31.77, 32.05, 31.55, 31.96]], //02/10/15
    110. [1423688400000, [31.49, 31.82, 31.35, 31.77]], //02/11/15
    111. [1423774800000, [31.70, 31.99, 30.71, 30.89]], //02/12/15
    112. [1423861200000, [30.99, 31.57, 30.50, 31.55]], //02/13/15
    113.  
    114. [1424206800000, [30.02, 30.30, 29.98, 30.27]], //02/17/15
    115. [1424293200000, [30.34, 30.90, 30.15, 30.80]], //02/18/15
    116. [1424379600000, [30.85, 30.91, 30.05, 30.15]], //02/19/15
    117. [1424466000000, [29.88, 30.21, 29.80, 30.21]], //02/20/15
    118.  
    119. [1424725200000, [30.22, 30.30, 30.10, 30.17]], //02/23/15
    120. [1424811600000, [30.15, 30.45, 30.01, 30.39]], //02/24/15
    121. [1424898000000, [30.45, 31.06, 30.40, 30.91]], //02/25/15
    122. [1424984400000, [30.94, 31.01, 30.81, 30.89]], //02/26/15
    123. [1425070800000, [30.83, 31.27, 30.75, 30.99]], //02/27/15
    124.  
    125. [1425330000000, [30.90, 31.12, 30.85, 31.11]], //03/02/15
    126. [1425416400000, [31.05, 31.08, 30.78, 30.86]], //03/03/15
    127. [1425502800000, [30.76, 30.77, 30.47, 30.66]], //03/04/15
    128. [1425589200000, [30.62, 30.82, 30.57, 30.82]], //03/05/15
    129. [1425675600000, [30.71, 30.78, 30.33, 30.42]], //03/06/15
    130.  
    131. [1425934800000, [30.52, 30.70, 30.49, 30.64]], //03/09/15
    132. [1426021200000, [30.50, 30.64, 30.17, 30.17]], //03/10/15
    133. [1426107600000, [30.28, 30.49, 30.15, 30.19]], //03/11/15
    134. [1426194000000, [30.27, 30.41, 30.17, 30.40]], //03/12/15
    135. [1426280400000, [30.28, 30.36, 29.81, 30.04]], //03/13/15
    136.  
    137. [1426539600000, [30.06, 30.48, 29.96, 30.45]], //03/16/15
    138. [1426626000000, [30.30, 30.39, 30.09, 30.31]], //03/17/15
    139. [1426712400000, [30.18, 30.85, 30.11, 30.64]], //03/18/15
    140. [1426798800000, [30.44, 30.61, 30.26, 30.33]], //03/19/15
    141. [1426885200000, [30.34, 30.53, 30.30, 30.40]], //03/20/15
    142.  
    143. [1427144400000, [30.48, 30.74, 30.45, 30.47]], //03/23/15
    144. [1427230800000, [30.38, 30.48, 30.27, 30.28]], //03/24/15
    145. [1427317200000, [30.23, 30.33, 29.91, 29.91]], //03/25/15
    146. [1427403600000, [30.80, 30.92, 30.17, 30.30]], //03/26/15
    147. [1427490000000, [30.34, 30.90, 29.60, 29.64]], //03/27/15
    148.  
    149. [1427749200000, [29.98, 30.20, 29.97, 30.12]], //03/30/15
    150. [1427835600000, [30.15, 30.90, 29.81, 30.81]] //03/31/15
    151. ]
    152. }]
    153. };
    154.  
    155. zingchart.render({
    156. id: 'myChart',
    157. data: myConfig,
    158. height: 400,
    159. width: "100%"
    160. });
    161. </script>
    162. </body>
    163.  
    164. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. </head>
    10.  
    11. <body>
    12. <div id='myChart'></div>
    13. </body>
    14.  
    15. </html>
    1.  
    1. var myConfig = {
    2. "type": "stock",
    3. "title": {
    4. "text": "Stock Chart with Preview Chart"
    5. },
    6. "plotarea": {
    7. "margin-bottom": "30%" //so the chart and preview don't squish together
    8. },
    9. "plot": {
    10. "aspect": "whisker",
    11. "tooltip": {
    12. "visible": false
    13. },
    14. "trend-up": {
    15. "line-color": "#00AAA0"
    16. },
    17. "trend-down": {
    18. "line-color": "#1E435D"
    19. },
    20. "preview": {
    21. "type": "area", //"area" (default) or "line"
    22. "line-color": "purple",
    23. "line-width": 1,
    24. "line-style": "dashdot",
    25. "background-color": "yellow", //one color only
    26. "alpha": 0.9,
    27. "alpha-area": 0.3
    28. }
    29. },
    30. "scale-x": {
    31. "min-value": 1420232400000,
    32. "step": "day",
    33. "transform": {
    34. "type": "date",
    35. "all": "%D,<br>%m/%d"
    36. },
    37. "max-items": 4,
    38. "zooming": true,
    39. "zoom-to-values": [1421787600000, 1426280400000]
    40. },
    41. "scale-y": {
    42. "values": "29:33:1",
    43. "format": "$%v",
    44. "guide": {
    45. "line-style": "solid"
    46. }
    47. },
    48. "preview": {
    49.  
    50. },
    51. "crosshair-x": {
    52. "plot-label": {
    53. "text": "Open: $%open<br>High: $%high<br>Low: $%low<br>Close: $%close",
    54. "decimals": 2
    55. },
    56. "scale-label": {
    57. "text": "%v" //seems to abide by "scale tokens", i.e., only %v works here.
    58. }
    59. },
    60. "series": [{
    61. "values": [
    62. [1420232400000, [31.34, 31.46, 30.87, 31.06]], //01/02/15
    63.  
    64. [1420491600000, [31.80, 32.25, 31.52, 32.05]], //01/05/15
    65. [1420578000000, [32.05, 32.57, 31.93, 32.30]], //01/06/15
    66. [1420664400000, [32.21, 32.39, 31.98, 32.08]], //01/07/15
    67. [1420750800000, [32.32, 32.38, 32.13, 32.37]], //01/08/15
    68. [1420837200000, [32.52, 32.53, 31.95, 32.03]], //01/09/15
    69.  
    70. [1421096400000, [32.07, 32.14, 31.77, 31.98]], //01/12/15
    71. [1421182800000, [32.26, 32.33, 31.61, 31.86]], //01/13/15
    72. [1421269200000, [31.65, 31.85, 31.41, 31.78]], //01/14/15
    73. [1421355600000, [31.86, 31.97, 31.56, 31.58]], //01/15/15
    74. [1421442000000, [31.51, 31.65, 31.45, 31.59]], //01/16/15
    75.  
    76. [1421787600000, [31.84, 31.87, 31.55, 31.85]], //01/20/15
    77. [1421874000000, [31.83, 32.08, 31.71, 32.04]], //01/21/15
    78. [1421960400000, [32.30, 32.36, 31.96, 32.28]], //01/22/15
    79. [1422046800000, [32.43, 32.88, 32.29, 32.48]], //01/23/15
    80.  
    81. [1422306000000, [32.72, 32.74, 32.40, 32.60]], //01/26/15
    82. [1422392400000, [32.39, 32.46, 32.20, 32.38]], //01/27/15
    83. [1422478800000, [32.47, 32.49, 31.81, 31.84]], //01/28/15
    84. [1422565200000, [31.84, 32.20, 31.78, 32.08]], //01/29/15
    85. [1422651600000, [31.88, 32.11, 31.82, 31.89]], //01/30/15
    86.  
    87. [1422910800000, [32.00, 32.22, 31.90, 32.21]], //02/02/15
    88. [1422997200000, [32.29, 32.52, 32.26, 32.47]], //02/03/15
    89. [1423083600000, [32.41, 32.43, 32.08, 32.16]], //02/04/15
    90. [1423170000000, [32.25, 32.50, 32.23, 32.50]], //02/05/15
    91. [1423256400000, [32.54, 32.75, 32.47, 32.52]], //02/06/15
    92.  
    93. [1423515600000, [32.47, 32.75, 31.50, 31.64]], //02/09/15
    94. [1423602000000, [31.77, 32.05, 31.55, 31.96]], //02/10/15
    95. [1423688400000, [31.49, 31.82, 31.35, 31.77]], //02/11/15
    96. [1423774800000, [31.70, 31.99, 30.71, 30.89]], //02/12/15
    97. [1423861200000, [30.99, 31.57, 30.50, 31.55]], //02/13/15
    98.  
    99. [1424206800000, [30.02, 30.30, 29.98, 30.27]], //02/17/15
    100. [1424293200000, [30.34, 30.90, 30.15, 30.80]], //02/18/15
    101. [1424379600000, [30.85, 30.91, 30.05, 30.15]], //02/19/15
    102. [1424466000000, [29.88, 30.21, 29.80, 30.21]], //02/20/15
    103.  
    104. [1424725200000, [30.22, 30.30, 30.10, 30.17]], //02/23/15
    105. [1424811600000, [30.15, 30.45, 30.01, 30.39]], //02/24/15
    106. [1424898000000, [30.45, 31.06, 30.40, 30.91]], //02/25/15
    107. [1424984400000, [30.94, 31.01, 30.81, 30.89]], //02/26/15
    108. [1425070800000, [30.83, 31.27, 30.75, 30.99]], //02/27/15
    109.  
    110. [1425330000000, [30.90, 31.12, 30.85, 31.11]], //03/02/15
    111. [1425416400000, [31.05, 31.08, 30.78, 30.86]], //03/03/15
    112. [1425502800000, [30.76, 30.77, 30.47, 30.66]], //03/04/15
    113. [1425589200000, [30.62, 30.82, 30.57, 30.82]], //03/05/15
    114. [1425675600000, [30.71, 30.78, 30.33, 30.42]], //03/06/15
    115.  
    116. [1425934800000, [30.52, 30.70, 30.49, 30.64]], //03/09/15
    117. [1426021200000, [30.50, 30.64, 30.17, 30.17]], //03/10/15
    118. [1426107600000, [30.28, 30.49, 30.15, 30.19]], //03/11/15
    119. [1426194000000, [30.27, 30.41, 30.17, 30.40]], //03/12/15
    120. [1426280400000, [30.28, 30.36, 29.81, 30.04]], //03/13/15
    121.  
    122. [1426539600000, [30.06, 30.48, 29.96, 30.45]], //03/16/15
    123. [1426626000000, [30.30, 30.39, 30.09, 30.31]], //03/17/15
    124. [1426712400000, [30.18, 30.85, 30.11, 30.64]], //03/18/15
    125. [1426798800000, [30.44, 30.61, 30.26, 30.33]], //03/19/15
    126. [1426885200000, [30.34, 30.53, 30.30, 30.40]], //03/20/15
    127.  
    128. [1427144400000, [30.48, 30.74, 30.45, 30.47]], //03/23/15
    129. [1427230800000, [30.38, 30.48, 30.27, 30.28]], //03/24/15
    130. [1427317200000, [30.23, 30.33, 29.91, 29.91]], //03/25/15
    131. [1427403600000, [30.80, 30.92, 30.17, 30.30]], //03/26/15
    132. [1427490000000, [30.34, 30.90, 29.60, 29.64]], //03/27/15
    133.  
    134. [1427749200000, [29.98, 30.20, 29.97, 30.12]], //03/30/15
    135. [1427835600000, [30.15, 30.90, 29.81, 30.81]] //03/31/15
    136. ]
    137. }]
    138. };
    139.  
    140. zingchart.render({
    141. id: 'myChart',
    142. data: myConfig,
    143. height: 400,
    144. width: "100%"
    145. });