• 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='zoomOut'>zoomOut()</button>
    30. <a href='#' id='reset'>Reset</a>
    31. <br><br>
    32. <div id='myChart'></div>
    33.  
    34. <script>
    35. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    36. zingchart.loadModules('maps, maps-usa', function(e) {
    37. zingchart.render({
    38. id: 'myChart',
    39. data: {
    40. shapes: [{
    41. type: 'zingchart.maps',
    42. options: {
    43. name: 'usa',
    44. zoom: 3
    45. }
    46. }]
    47. },
    48. height: 350,
    49. width: '100%'
    50. });
    51. });
    52.  
    53. document.getElementById('zoomOut').addEventListener('click', function(e) {
    54. zingchart.maps.zoomOut('usa');
    55. });
    56.  
    57. document.getElementById('reset').addEventListener('click', function(e) {
    58. zingchart.maps.zoomIn('usa');
    59. });
    60. </script>
    61. </body>
    62.  
    63. </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='zoomOut'>zoomOut()</button>
    14. <a href='#' id='reset'>Reset</a>
    15. <br><br>
    16. <div id='myChart'></div>
    17.  
    18. </body>
    19.  
    20. </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('zoomOut').addEventListener('click', function(e) {
    19. zingchart.maps.zoomOut('usa');
    20. });
    21.  
    22. document.getElementById('reset').addEventListener('click', function(e) {
    23. zingchart.maps.zoomIn('usa');
    24. });