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