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