• 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. height: 100%;
    13. width: 100%;
    14. margin: 0;
    15. padding: 0;
    16. }
    17.  
    18. #myChart {
    19. height: 100%;
    20. width: 100%;
    21. min-height: 150px;
    22. }
    23.  
    24. .zc-ref {
    25. display: none;
    26. }
    27. </style>
    28. </head>
    29.  
    30. <body>
    31. <div id="zc"></div>
    32. <script>
    33. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    34. var IDS = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
    35. var data = {};
    36. for (var i = 0; i < IDS.length; i++) {
    37. data[IDS[i]] = {
    38. value: ZC._r_(0, 100)
    39. };
    40. }
    41.  
    42. var cdata = {
    43. "type": "tilemap",
    44. "options": {
    45. "map": "USA",
    46. "type": "hex",
    47. "size-factor": 1.1,
    48. "data": data,
    49. "tile": {
    50. "border-width": 1,
    51. "border-color": "#fff"
    52. },
    53. "groups": [{
    54. "rule": "%value >= 0 && %value < 25",
    55. "background-color": "#89b92e",
    56. "text": "0-25"
    57. },
    58. {
    59. "rule": "%value >= 25 && %value < 50",
    60. "background-color": "#0392bb",
    61. "text": "25-50"
    62. },
    63. {
    64. "rule": "%value >= 50 && %value < 75",
    65. "background-color": "#cc3300",
    66. "text": "50-75"
    67. },
    68. {
    69. "rule": "%value >= 75 && %value < 100",
    70. "background-color": "#da9b04",
    71. "text": "75-100"
    72. }
    73. ]
    74. },
    75. "tooltip": {
    76. "padding": 10,
    77. "border-width": 1,
    78. "border-color": "#333",
    79. "font-weight": "600"
    80. },
    81. "legend": {
    82. "margin": "auto auto 10 auto",
    83. "layout": "float",
    84. "marker": {
    85. "type": "circle"
    86. }
    87. },
    88. "plotarea": {
    89. "margin": "10 10 40 10"
    90. }
    91. };
    92.  
    93. zingchart.render({
    94. id: 'zc',
    95. width: 640,
    96. height: 480,
    97. output: 'svg',
    98. data: cdata
    99. });
    100. </script>
    101. </body>
    102.  
    103. </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="zc"></div>
    13. </body>
    14.  
    15. </html>
    1. html,
    2. body {
    3. height: 100%;
    4. width: 100%;
    5. margin: 0;
    6. padding: 0;
    7. }
    8.  
    9. #myChart {
    10. height: 100%;
    11. width: 100%;
    12. min-height: 150px;
    13. }
    14.  
    15. .zc-ref {
    16. display: none;
    17. }
    1. var IDS = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
    2. var data = {};
    3. for (var i = 0; i < IDS.length; i++) {
    4. data[IDS[i]] = {
    5. value: ZC._r_(0, 100)
    6. };
    7. }
    8.  
    9. var cdata = {
    10. "type": "tilemap",
    11. "options": {
    12. "map": "USA",
    13. "type": "hex",
    14. "size-factor": 1.1,
    15. "data": data,
    16. "tile": {
    17. "border-width": 1,
    18. "border-color": "#fff"
    19. },
    20. "groups": [{
    21. "rule": "%value >= 0 && %value < 25",
    22. "background-color": "#89b92e",
    23. "text": "0-25"
    24. },
    25. {
    26. "rule": "%value >= 25 && %value < 50",
    27. "background-color": "#0392bb",
    28. "text": "25-50"
    29. },
    30. {
    31. "rule": "%value >= 50 && %value < 75",
    32. "background-color": "#cc3300",
    33. "text": "50-75"
    34. },
    35. {
    36. "rule": "%value >= 75 && %value < 100",
    37. "background-color": "#da9b04",
    38. "text": "75-100"
    39. }
    40. ]
    41. },
    42. "tooltip": {
    43. "padding": 10,
    44. "border-width": 1,
    45. "border-color": "#333",
    46. "font-weight": "600"
    47. },
    48. "legend": {
    49. "margin": "auto auto 10 auto",
    50. "layout": "float",
    51. "marker": {
    52. "type": "circle"
    53. }
    54. },
    55. "plotarea": {
    56. "margin": "10 10 40 10"
    57. }
    58. };
    59.  
    60. zingchart.render({
    61. id: 'zc',
    62. width: 640,
    63. height: 480,
    64. output: 'svg',
    65. data: cdata
    66. });