• 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>
    10. html,
    11. body,
    12. #myChart {
    13. height: 100%;
    14. width: 100%;
    15. }
    16. </style>
    17. </head>
    18.  
    19. <body>
    20. <div id='myChart'></div>
    21. <script>
    22. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    23. var myConfig = {
    24. "graphset": [{
    25. "type": "treemap",
    26. "plotarea": {
    27. "margin": "0 0 30 0"
    28. },
    29. "options": {
    30. "hover-state": {
    31. "alpha": 1,
    32. "background-color": "black"
    33. }
    34. },
    35. "series": [{
    36. "text": "North America",
    37. "children": [{
    38. "text": "United States",
    39. "children": [{
    40. "text": "Texas",
    41. "value": 21
    42. },
    43. {
    44. "text": "California",
    45. "value": 53
    46. },
    47. {
    48. "text": "Ohio",
    49. "value": 12
    50. },
    51. {
    52. "text": "New York",
    53. "value": 46
    54. },
    55. {
    56. "text": "Michigan",
    57. "value": 39
    58. },
    59. {
    60. "text": "Alabama",
    61. "value": 25
    62. }
    63. ]
    64. },
    65. {
    66. "text": "Canada",
    67. "value": 113
    68. },
    69. {
    70. "text": "Mexico",
    71. "value": 78
    72. }
    73. ]
    74. },
    75. {
    76. "text": "Europe",
    77. "children": [{
    78. "text": "France",
    79. "value": 42
    80. },
    81. {
    82. "text": "Spain",
    83. "value": 28
    84. },
    85. {
    86. "text": "Switzerland",
    87. "value": 13
    88. },
    89. {
    90. "text": "Germany",
    91. "value": 56
    92. },
    93. {
    94. "text": "Cyprus",
    95. "value": 7
    96. }
    97. ]
    98. },
    99. {
    100. "text": "Africa",
    101. "children": [{
    102. "text": "Egypt",
    103. "value": 22
    104. },
    105. {
    106. "text": "Congo",
    107. "value": 38
    108. },
    109. {
    110. "text": "Lesotho",
    111. "value": 9
    112. }
    113. ]
    114. },
    115. {
    116. "text": "Asia",
    117. "children": [{
    118. "text": "India",
    119. "value": 92
    120. },
    121. {
    122. "text": "China",
    123. "value": 68
    124. },
    125. {
    126. "text": "Mongolia",
    127. "value": 25
    128. }
    129. ]
    130. },
    131. {
    132. "text": "South America",
    133. "children": [{
    134. "text": "Brazil",
    135. "value": 42
    136. },
    137. {
    138. "text": "Argentina",
    139. "value": 28
    140. },
    141. {
    142. "text": "Peru",
    143. "value": 15
    144. },
    145. {
    146. "text": "Uruguay",
    147. "value": 33
    148. }
    149. ]
    150. },
    151. {
    152. "text": "Australia (continent)",
    153. "children": [{
    154. "text": "Australia (country)",
    155. "value": 121
    156. },
    157. {
    158. "text": "New Zealand",
    159. "value": 24
    160. }
    161. ]
    162. }
    163. ]
    164. }]
    165. };
    166.  
    167. zingchart.render({
    168. id: 'myChart',
    169. data: myConfig,
    170. height: "100%",
    171. width: "100%"
    172. });
    173. </script>
    174. </body>
    175.  
    176. </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. html,
    2. body,
    3. #myChart {
    4. height: 100%;
    5. width: 100%;
    6. }
    1. var myConfig = {
    2. "graphset": [{
    3. "type": "treemap",
    4. "plotarea": {
    5. "margin": "0 0 30 0"
    6. },
    7. "options": {
    8. "hover-state": {
    9. "alpha": 1,
    10. "background-color": "black"
    11. }
    12. },
    13. "series": [{
    14. "text": "North America",
    15. "children": [{
    16. "text": "United States",
    17. "children": [{
    18. "text": "Texas",
    19. "value": 21
    20. },
    21. {
    22. "text": "California",
    23. "value": 53
    24. },
    25. {
    26. "text": "Ohio",
    27. "value": 12
    28. },
    29. {
    30. "text": "New York",
    31. "value": 46
    32. },
    33. {
    34. "text": "Michigan",
    35. "value": 39
    36. },
    37. {
    38. "text": "Alabama",
    39. "value": 25
    40. }
    41. ]
    42. },
    43. {
    44. "text": "Canada",
    45. "value": 113
    46. },
    47. {
    48. "text": "Mexico",
    49. "value": 78
    50. }
    51. ]
    52. },
    53. {
    54. "text": "Europe",
    55. "children": [{
    56. "text": "France",
    57. "value": 42
    58. },
    59. {
    60. "text": "Spain",
    61. "value": 28
    62. },
    63. {
    64. "text": "Switzerland",
    65. "value": 13
    66. },
    67. {
    68. "text": "Germany",
    69. "value": 56
    70. },
    71. {
    72. "text": "Cyprus",
    73. "value": 7
    74. }
    75. ]
    76. },
    77. {
    78. "text": "Africa",
    79. "children": [{
    80. "text": "Egypt",
    81. "value": 22
    82. },
    83. {
    84. "text": "Congo",
    85. "value": 38
    86. },
    87. {
    88. "text": "Lesotho",
    89. "value": 9
    90. }
    91. ]
    92. },
    93. {
    94. "text": "Asia",
    95. "children": [{
    96. "text": "India",
    97. "value": 92
    98. },
    99. {
    100. "text": "China",
    101. "value": 68
    102. },
    103. {
    104. "text": "Mongolia",
    105. "value": 25
    106. }
    107. ]
    108. },
    109. {
    110. "text": "South America",
    111. "children": [{
    112. "text": "Brazil",
    113. "value": 42
    114. },
    115. {
    116. "text": "Argentina",
    117. "value": 28
    118. },
    119. {
    120. "text": "Peru",
    121. "value": 15
    122. },
    123. {
    124. "text": "Uruguay",
    125. "value": 33
    126. }
    127. ]
    128. },
    129. {
    130. "text": "Australia (continent)",
    131. "children": [{
    132. "text": "Australia (country)",
    133. "value": 121
    134. },
    135. {
    136. "text": "New Zealand",
    137. "value": 24
    138. }
    139. ]
    140. }
    141. ]
    142. }]
    143. };
    144.  
    145. zingchart.render({
    146. id: 'myChart',
    147. data: myConfig,
    148. height: "100%",
    149. width: "100%"
    150. });