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