• 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'>Open Modal Small</button>
    17. <button class='btn btn-info' id='demo2'>Open Modal Fullscreen</button>
    18. <button class='btn btn-info' id='demo3'>CloseModal</button>
    19. <pre id='output'></pre>
    20. <script>
    21. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    22. var myConfig = {
    23. 'type': 'line',
    24. crosshairX: {
    25. guide: {
    26. visible: false
    27. }
    28. },
    29. title: {
    30.  
    31. },
    32. 'series': [{
    33. 'values': [11, 26, 7, 44, 19]
    34. }]
    35. };
    36.  
    37. var modalConfig = {
    38. type: 'bar',
    39. series: [{
    40. values: [11, 26, 7, 44, 19]
    41. }]
    42. };
    43.  
    44. demo1.addEventListener('click', function() {
    45. zingchart.exec('demo-chart-modal', 'destroy');
    46. zingchart.exec('demo-chart', 'openmodal', {
    47. height: 200,
    48. width: 500,
    49. });
    50.  
    51. zingchart.render({
    52. id: 'demo-chart-modal',
    53. data: modalConfig,
    54. height: 200,
    55. width: '100%'
    56. });
    57. });
    58.  
    59. demo2.addEventListener('click', function() {
    60. // properly destroy chart to avoid console errors
    61. zingchart.exec('demo-chart-modal', 'destroy');
    62. zingchart.exec('demo-chart', 'openmodal');
    63. document.getElementById('demo-chart-modal').innerHTML = "Hello Modal!";
    64. });
    65.  
    66.  
    67. demo3.addEventListener('click', function() {
    68. // properly destroy chart to avoid console errors
    69. zingchart.exec('demo-chart-modal', 'destroy');
    70. zingchart.exec('demo-chart', 'closemodal');
    71. });
    72.  
    73. zingchart.bind(null, 'beforedestroy', function(e) {
    74. zcdocs.demos.dump('beforedestroy', e);
    75. });
    76.  
    77. zingchart.bind(null, 'destroy', function(e) {
    78. if (e.id === 'demo-chart-modal')
    79. document.getElementById('demo-chart-modal').innerHTML;
    80.  
    81. zcdocs.demos.dump('destroy', e);
    82. });
    83.  
    84. zingchart.render({
    85. id: 'demo-chart',
    86. data: myConfig,
    87. height: 350,
    88. width: '100%'
    89. });
    90. </script>
    91. </body>
    92.  
    93. </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'>Open Modal Small</button>
    16. <button class='btn btn-info' id='demo2'>Open Modal Fullscreen</button>
    17. <button class='btn btn-info' id='demo3'>CloseModal</button>
    18. <pre id='output'></pre>
    19. </body>
    20.  
    21. </html>
    1.  
    1. var myConfig = {
    2. 'type': 'line',
    3. crosshairX: {
    4. guide: {
    5. visible: false
    6. }
    7. },
    8. title: {
    9.  
    10. },
    11. 'series': [{
    12. 'values': [11, 26, 7, 44, 19]
    13. }]
    14. };
    15.  
    16. var modalConfig = {
    17. type: 'bar',
    18. series: [{
    19. values: [11, 26, 7, 44, 19]
    20. }]
    21. };
    22.  
    23. demo1.addEventListener('click', function() {
    24. zingchart.exec('demo-chart-modal', 'destroy');
    25. zingchart.exec('demo-chart', 'openmodal', {
    26. height: 200,
    27. width: 500,
    28. });
    29.  
    30. zingchart.render({
    31. id: 'demo-chart-modal',
    32. data: modalConfig,
    33. height: 200,
    34. width: '100%'
    35. });
    36. });
    37.  
    38. demo2.addEventListener('click', function() {
    39. // properly destroy chart to avoid console errors
    40. zingchart.exec('demo-chart-modal', 'destroy');
    41. zingchart.exec('demo-chart', 'openmodal');
    42. document.getElementById('demo-chart-modal').innerHTML = "Hello Modal!";
    43. });
    44.  
    45.  
    46. demo3.addEventListener('click', function() {
    47. // properly destroy chart to avoid console errors
    48. zingchart.exec('demo-chart-modal', 'destroy');
    49. zingchart.exec('demo-chart', 'closemodal');
    50. });
    51.  
    52. zingchart.bind(null, 'beforedestroy', function(e) {
    53. zcdocs.demos.dump('beforedestroy', e);
    54. });
    55.  
    56. zingchart.bind(null, 'destroy', function(e) {
    57. if (e.id === 'demo-chart-modal')
    58. document.getElementById('demo-chart-modal').innerHTML;
    59.  
    60. zcdocs.demos.dump('destroy', e);
    61. });
    62.  
    63. zingchart.render({
    64. id: 'demo-chart',
    65. data: myConfig,
    66. height: 350,
    67. width: '100%'
    68. });