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