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