• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8.  
    9. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    10. <style>
    11. html,
    12. body {
    13. margin: 0;
    14. padding: 0;
    15. }
    16.  
    17. #myChart {
    18. height: 350px;
    19. width: 100%;
    20. }
    21.  
    22. pre {
    23. white-space: pre-wrap;
    24. }
    25. </style>
    26. </head>
    27.  
    28. <body>
    29. <button id='viewAll'>viewAll()</button>
    30. <a href='#' id='reset'>Reset</a>
    31. <br><br>
    32. <div id='myChart'></div>
    33. <script>
    34. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    35. zingchart.loadModules('maps, maps-usa', function(e) {
    36. zingchart.render({
    37. id: 'myChart',
    38. data: {
    39. shapes: [{
    40. type: 'zingchart.maps',
    41. options: {
    42. name: 'usa',
    43. zoom: 3
    44. }
    45. }]
    46. },
    47. height: 350,
    48. width: '100%'
    49. });
    50. });
    51.  
    52. document.getElementById('viewAll').addEventListener('click', function(e) {
    53. zingchart.maps.viewAll('usa');
    54. });
    55.  
    56. document.getElementById('reset').addEventListener('click', function(e) {
    57. zingchart.maps.zoomIn('usa');
    58. });
    59. </script>
    60. </body>
    61.  
    62. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8.  
    9. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    10. </head>
    11.  
    12. <body>
    13. <button id='viewAll'>viewAll()</button>
    14. <a href='#' id='reset'>Reset</a>
    15. <br><br>
    16. <div id='myChart'></div>
    17. </body>
    18.  
    19. </html>
    1. html,
    2. body {
    3. margin: 0;
    4. padding: 0;
    5. }
    6.  
    7. #myChart {
    8. height: 350px;
    9. width: 100%;
    10. }
    11.  
    12. pre {
    13. white-space: pre-wrap;
    14. }
    1. zingchart.loadModules('maps, maps-usa', function(e) {
    2. zingchart.render({
    3. id: 'myChart',
    4. data: {
    5. shapes: [{
    6. type: 'zingchart.maps',
    7. options: {
    8. name: 'usa',
    9. zoom: 3
    10. }
    11. }]
    12. },
    13. height: 350,
    14. width: '100%'
    15. });
    16. });
    17.  
    18. document.getElementById('viewAll').addEventListener('click', function(e) {
    19. zingchart.maps.viewAll('usa');
    20. });
    21.  
    22. document.getElementById('reset').addEventListener('click', function(e) {
    23. zingchart.maps.zoomIn('usa');
    24. });