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