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