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