• 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='method'>zoomToItem()</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. }
    44. }]
    45. },
    46. height: 350,
    47. width: '100%'
    48. });
    49. });
    50.  
    51. document.getElementById('method').addEventListener('click', function(e) {
    52. zingchart.maps.zoomToItem('usa', 'CA');
    53. });
    54.  
    55. document.getElementById('reset').addEventListener('click', function(e) {
    56. zingchart.maps.viewAll('usa');
    57. });
    58. </script>
    59. </body>
    60.  
    61. </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='method'>zoomToItem()</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. }
    10. }]
    11. },
    12. height: 350,
    13. width: '100%'
    14. });
    15. });
    16.  
    17. document.getElementById('method').addEventListener('click', function(e) {
    18. zingchart.maps.zoomToItem('usa', 'CA');
    19. });
    20.  
    21. document.getElementById('reset').addEventListener('click', function(e) {
    22. zingchart.maps.viewAll('usa');
    23. });