• 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. <script>
    20. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    21. var myConfig = {
    22. 'type': 'line',
    23. crosshairX: {
    24. guide: {
    25. visible: false
    26. }
    27. },
    28. title: {
    29.  
    30. },
    31. 'series': [{
    32. 'values': [11, 26, 7, 44, 19]
    33. }]
    34. };
    35.  
    36. var modalConfig = {
    37. type: 'bar',
    38. series: [{
    39. values: [11, 26, 7, 44, 19]
    40. }]
    41. };
    42.  
    43. zingchart.render({
    44. id: 'demo-chart',
    45. data: myConfig,
    46. height: 400,
    47. width: '100%'
    48. });
    49.  
    50. demo1.addEventListener('click', function() {
    51. zingchart.exec('demo-chart', 'openmodal', {
    52. height: 200,
    53. width: 500,
    54. });
    55.  
    56. zingchart.render({
    57. id: 'demo-chart-modal',
    58. data: modalConfig,
    59. height: 200,
    60. width: '100%'
    61. });
    62. });
    63.  
    64. demo2.addEventListener('click', function() {
    65. // properly destroy chart to avoid console errors
    66. zingchart.exec('demo-chart-modal', 'destroy');
    67. zingchart.exec('demo-chart', 'openmodal');
    68. document.getElementById('demo-chart-modal').innerHTML = "Hello Modal!";
    69. });
    70.  
    71.  
    72. demo3.addEventListener('click', function() {
    73. // properly destroy chart to avoid console errors
    74. zingchart.exec('demo-chart-modal', 'destroy');
    75. zingchart.exec('demo-chart', 'closemodal');
    76. });
    77. </script>
    78. </body>
    79.  
    80. </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. </body>
    19.  
    20. </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. zingchart.render({
    24. id: 'demo-chart',
    25. data: myConfig,
    26. height: 400,
    27. width: '100%'
    28. });
    29.  
    30. demo1.addEventListener('click', function() {
    31. zingchart.exec('demo-chart', 'openmodal', {
    32. height: 200,
    33. width: 500,
    34. });
    35.  
    36. zingchart.render({
    37. id: 'demo-chart-modal',
    38. data: modalConfig,
    39. height: 200,
    40. width: '100%'
    41. });
    42. });
    43.  
    44. demo2.addEventListener('click', function() {
    45. // properly destroy chart to avoid console errors
    46. zingchart.exec('demo-chart-modal', 'destroy');
    47. zingchart.exec('demo-chart', 'openmodal');
    48. document.getElementById('demo-chart-modal').innerHTML = "Hello Modal!";
    49. });
    50.  
    51.  
    52. demo3.addEventListener('click', function() {
    53. // properly destroy chart to avoid console errors
    54. zingchart.exec('demo-chart-modal', 'destroy');
    55. zingchart.exec('demo-chart', 'closemodal');
    56. });