• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script nonce="undefined" src="//www.zingchart.com/scripts/zcDocs.js"></script>
    8. <link href='//www.zingchart.com/css/zcDocs.css' rel='stylesheet' type='text/css'>
    9.  
    10. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    11. <style></style>
    12. </head>
    13.  
    14. <body>
    15. <div id='demo-chart'></div>
    16. <button class='btn btn-info' id='demo1'>Toggle Plot 1</button>
    17. <button class='btn btn-info' id='demo2'>Toggle Plot 2</button>
    18. <button class='btn btn-info' id='demo3'>Toggle Plot 3</button>
    19. <script>
    20. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    21. var myConfig = {
    22. 'type': 'line',
    23. 'title': {
    24. 'text': 'toggle plot'
    25. },
    26. 'legend': {},
    27. 'series': [{
    28. 'values': [11, 26, 7, 44, 11],
    29. 'id': 'test_id'
    30. },
    31.  
    32. {
    33. 'values': [111, 226, 73, 434, 112]
    34. },
    35.  
    36. {
    37. 'values': [35, 122, 67, 234, 55]
    38. }
    39. ]
    40. };
    41.  
    42. zingchart.render({
    43. id: 'demo-chart',
    44. data: myConfig,
    45. height: 400,
    46. width: '100%'
    47. });
    48.  
    49. demo1.addEventListener('click', function() {
    50. let output = zingchart.exec('demo-chart', 'toggleplot', {
    51. plotid: 'test_id'
    52. });
    53. zcdocs.demos.dump('toggleplot', output);
    54. });
    55.  
    56. demo2.addEventListener('click', function() {
    57. let output = zingchart.exec('demo-chart', 'toggleplot', {
    58. plotindex: 1
    59. });
    60. zcdocs.demos.dump('toggleplot', output);
    61. });
    62.  
    63. demo3.addEventListener('click', function() {
    64. let output = zingchart.exec('demo-chart', 'toggleplot');
    65. zcdocs.demos.dump('toggleplot', output);
    66. });
    67. </script>
    68. </body>
    69.  
    70. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script src="//www.zingchart.com/scripts/zcDocs.js"></script>
    8. <link href='//www.zingchart.com/css/zcDocs.css' rel='stylesheet' type='text/css'>
    9.  
    10. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    11. </head>
    12.  
    13. <body>
    14. <div id='demo-chart'></div>
    15. <button class='btn btn-info' id='demo1'>Toggle Plot 1</button>
    16. <button class='btn btn-info' id='demo2'>Toggle Plot 2</button>
    17. <button class='btn btn-info' id='demo3'>Toggle Plot 3</button>
    18. </body>
    19.  
    20. </html>
    1.  
    1. var myConfig = {
    2. 'type': 'line',
    3. 'title': {
    4. 'text': 'toggle plot'
    5. },
    6. 'legend': {},
    7. 'series': [{
    8. 'values': [11, 26, 7, 44, 11],
    9. 'id': 'test_id'
    10. },
    11.  
    12. {
    13. 'values': [111, 226, 73, 434, 112]
    14. },
    15.  
    16. {
    17. 'values': [35, 122, 67, 234, 55]
    18. }
    19. ]
    20. };
    21.  
    22. zingchart.render({
    23. id: 'demo-chart',
    24. data: myConfig,
    25. height: 400,
    26. width: '100%'
    27. });
    28.  
    29. demo1.addEventListener('click', function() {
    30. let output = zingchart.exec('demo-chart', 'toggleplot', {
    31. plotid: 'test_id'
    32. });
    33. zcdocs.demos.dump('toggleplot', output);
    34. });
    35.  
    36. demo2.addEventListener('click', function() {
    37. let output = zingchart.exec('demo-chart', 'toggleplot', {
    38. plotindex: 1
    39. });
    40. zcdocs.demos.dump('toggleplot', output);
    41. });
    42.  
    43. demo3.addEventListener('click', function() {
    44. let output = zingchart.exec('demo-chart', 'toggleplot');
    45. zcdocs.demos.dump('toggleplot', output);
    46. });