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