• 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. <button id="zoomIn" type="button">Zoom In</button>
    32. <button id="zoomOut" type="button">Zoom Out</button>
    33. <button id="resetZoom" type="button">Reset</button>
    34. <div id="myChart"><a class="zc-ref" href="https://www.zingchart.com">Powered by ZingChart</a></div>
    35. <script>
    36. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    37. var myConfig = {
    38. "type": "scatter",
    39. "scale-x": {
    40. "values": ["a", "b", "c", "d", "e", "f"],
    41. "zooming": true
    42. },
    43. "scale-y": {
    44. "labels": ["a", "b", "c", "d", "e", "f"],
    45. "zooming": true,
    46. "step": 1,
    47. "fixed-step": true
    48. },
    49. zoom: {
    50. active: false
    51. },
    52. "scroll-x": {},
    53. "scroll-y": {},
    54. "series": [{
    55. "values": [
    56. [0, 0],
    57. [1, 1],
    58. [2, 2],
    59. [3, 3],
    60. [4, 4],
    61. [5, 5]
    62. ]
    63. }]
    64. };
    65.  
    66. zingchart.render({
    67. id: 'myChart',
    68. data: myConfig,
    69. height: 400,
    70. width: '100%'
    71. });
    72.  
    73. document.getElementById('zoomIn').addEventListener("click", function() {
    74. zingchart.exec('myChart', 'zoomin');
    75. });
    76.  
    77. document.getElementById('zoomOut').addEventListener("click", function() {
    78. zingchart.exec('myChart', 'zoomout');
    79. });
    80.  
    81. document.getElementById('resetZoom').addEventListener("click", function() {
    82. zingchart.exec('myChart', 'viewall');
    83. });
    84. </script>
    85. </body>
    86.  
    87. </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. <button id="zoomIn" type="button">Zoom In</button>
    13. <button id="zoomOut" type="button">Zoom Out</button>
    14. <button id="resetZoom" type="button">Reset</button>
    15. <div id="myChart"><a class="zc-ref" href="https://www.zingchart.com">Powered by ZingChart</a></div>
    16. </body>
    17.  
    18. </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 myConfig = {
    2. "type": "scatter",
    3. "scale-x": {
    4. "values": ["a", "b", "c", "d", "e", "f"],
    5. "zooming": true
    6. },
    7. "scale-y": {
    8. "labels": ["a", "b", "c", "d", "e", "f"],
    9. "zooming": true,
    10. "step": 1,
    11. "fixed-step": true
    12. },
    13. zoom: {
    14. active: false
    15. },
    16. "scroll-x": {},
    17. "scroll-y": {},
    18. "series": [{
    19. "values": [
    20. [0, 0],
    21. [1, 1],
    22. [2, 2],
    23. [3, 3],
    24. [4, 4],
    25. [5, 5]
    26. ]
    27. }]
    28. };
    29.  
    30. zingchart.render({
    31. id: 'myChart',
    32. data: myConfig,
    33. height: 400,
    34. width: '100%'
    35. });
    36.  
    37. document.getElementById('zoomIn').addEventListener("click", function() {
    38. zingchart.exec('myChart', 'zoomin');
    39. });
    40.  
    41. document.getElementById('zoomOut').addEventListener("click", function() {
    42. zingchart.exec('myChart', 'zoomout');
    43. });
    44.  
    45. document.getElementById('resetZoom').addEventListener("click", function() {
    46. zingchart.exec('myChart', 'viewall');
    47. });