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