• 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'>Clear Selection</button>
    17. <button class='btn btn-info' id='demo2'>Set Selection</button>
    18. <pre id='output'></pre>
    19. <script>
    20. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    21. var myConfig = {
    22. 'type': 'bar',
    23. 'plot': {
    24. 'selection-mode': 'multiple',
    25. 'background-mode': 'none',
    26. 'selected-state': {
    27. 'background-color': '#900 #f90',
    28. 'border-color': '#999',
    29. 'border-width': 1
    30. }
    31. },
    32. 'series': [{
    33. 'values': [11, 26, 7, 44, 11]
    34. },
    35. {
    36. 'values': [42, 13, 21, 15, 33]
    37. }
    38. ],
    39. 'selection': [
    40. [0, 3],
    41. [2, 4]
    42. ]
    43. };
    44.  
    45. zingchart.render({
    46. id: 'demo-chart',
    47. data: myConfig,
    48. height: 400,
    49. width: '100%'
    50. });
    51.  
    52. demo1.addEventListener('click', function() {
    53. let output = zingchart.exec('demo-chart', 'clearselection');
    54. zcdocs.demos.dump('clearselection', output);
    55. });
    56.  
    57. demo2.addEventListener('click', function() {
    58. let output = zingchart.exec('demo-chart', 'setselection', {
    59. 'selection': [
    60. [0, 3],
    61. [2, 4]
    62. ]
    63. });
    64. zcdocs.demos.dump('setselection', output);
    65. });
    66. </script>
    67. </body>
    68.  
    69. </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'>Clear Selection</button>
    16. <button class='btn btn-info' id='demo2'>Set Selection</button>
    17. <pre id='output'></pre>
    18. </body>
    19.  
    20. </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. 'selection': [
    20. [0, 3],
    21. [2, 4]
    22. ]
    23. };
    24.  
    25. zingchart.render({
    26. id: 'demo-chart',
    27. data: myConfig,
    28. height: 400,
    29. width: '100%'
    30. });
    31.  
    32. demo1.addEventListener('click', function() {
    33. let output = zingchart.exec('demo-chart', 'clearselection');
    34. zcdocs.demos.dump('clearselection', output);
    35. });
    36.  
    37. demo2.addEventListener('click', function() {
    38. let output = zingchart.exec('demo-chart', 'setselection', {
    39. 'selection': [
    40. [0, 3],
    41. [2, 4]
    42. ]
    43. });
    44. zcdocs.demos.dump('setselection', output);
    45. });