• 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-danger' id='restart'>Reset</button>
    17. <button class='btn btn-info' id='demo1'>Run Demo 1</button>
    18. <button class='btn btn-info' id='demo2'>Run Demo 2</button>
    19. <pre id='output'></pre>
    20. <script>
    21. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    22. var myConfig = {
    23. 'type': 'bar',
    24. 'plot': {
    25. 'selection-mode': 'multiple',
    26. 'background-mode': 'none',
    27. 'selected-state': {
    28. 'background-color': '#900 #f90',
    29. 'border-color': '#999',
    30. 'border-width': 1
    31. }
    32. },
    33. 'series': [{
    34. 'values': [11, 26, 7, 44, 11]
    35. },
    36. {
    37. 'values': [42, 13, 21, 15, 33]
    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', 'select', [{
    51. 'plotindex': 0,
    52. 'nodeindex': [0, 2]
    53. },
    54. {
    55. 'plotindex': 1,
    56. 'nodeindex': '1-3'
    57. }
    58. ]);
    59. zcdocs.demos.dump('select', output);
    60. });
    61.  
    62. demo2.addEventListener('click', function() {
    63. let output = zingchart.exec('demo-chart', 'select', [
    64.  
    65. {
    66. 'plotindex': 0,
    67. 'nodeindex': '0-2',
    68. 'toggle': true
    69. },
    70. {
    71. 'plotindex': 1,
    72. 'nodeindex': [1, 3]
    73. }
    74. ]);
    75. zcdocs.demos.dump('select', output);
    76. });
    77. restart.addEventListener('click', function() {
    78. zingchart.exec('demo-chart', 'reload');
    79. });
    80. </script>
    81. </body>
    82.  
    83. </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-danger' id='restart'>Reset</button>
    16. <button class='btn btn-info' id='demo1'>Run Demo 1</button>
    17. <button class='btn btn-info' id='demo2'>Run Demo 2</button>
    18. <pre id='output'></pre>
    19. </body>
    20.  
    21. </html>
    1.  
    1. var myConfig = {
    2. 'type': 'bar',
    3. 'plot': {
    4. 'selection-mode': 'multiple',
    5. 'background-mode': 'none',
    6. 'selected-state': {
    7. 'background-color': '#900 #f90',
    8. 'border-color': '#999',
    9. 'border-width': 1
    10. }
    11. },
    12. 'series': [{
    13. 'values': [11, 26, 7, 44, 11]
    14. },
    15. {
    16. 'values': [42, 13, 21, 15, 33]
    17. }
    18. ]
    19. };
    20.  
    21. zingchart.render({
    22. id: 'demo-chart',
    23. data: myConfig,
    24. height: 400,
    25. width: '100%'
    26. });
    27.  
    28. demo1.addEventListener('click', function() {
    29. let output = zingchart.exec('demo-chart', 'select', [{
    30. 'plotindex': 0,
    31. 'nodeindex': [0, 2]
    32. },
    33. {
    34. 'plotindex': 1,
    35. 'nodeindex': '1-3'
    36. }
    37. ]);
    38. zcdocs.demos.dump('select', output);
    39. });
    40.  
    41. demo2.addEventListener('click', function() {
    42. let output = zingchart.exec('demo-chart', 'select', [
    43.  
    44. {
    45. 'plotindex': 0,
    46. 'nodeindex': '0-2',
    47. 'toggle': true
    48. },
    49. {
    50. 'plotindex': 1,
    51. 'nodeindex': [1, 3]
    52. }
    53. ]);
    54. zcdocs.demos.dump('select', output);
    55. });
    56. restart.addEventListener('click', function() {
    57. zingchart.exec('demo-chart', 'reload');
    58. });