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