• 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='https://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>
    12. html,
    13. body {
    14. height: 100%;
    15. width: 100%;
    16. margin: 0;
    17. padding: 0;
    18. }
    19.  
    20. .chart--container {
    21. height: 100%;
    22. width: 100%;
    23. min-height: 150px;
    24. }
    25.  
    26. .zc-ref {
    27. display: none;
    28. }
    29. </style>
    30. </head>
    31.  
    32. <body>
    33. <div id='demo-chart'></div>
    34. <button class='btn btn-danger' id='reset'>Reset</button>
    35. <button class='btn btn-info' id='demo1'>Run Demo 1</button>
    36. <pre id='output'></pre>
    37. <script>
    38. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    39. var myConfig = {
    40. 'type': 'line',
    41. 'legend': {},
    42. 'series': [{
    43. 'values': [11, 26, 7, 44, 11]
    44. },
    45. {
    46. 'values': [42, 13, 21, 15, 33]
    47. }
    48. ]
    49. };
    50. zingchart.setdata = function(p) {
    51. zcdocs.demos.dump('setdata', p);
    52. }
    53. demo1.addEventListener('click', function() {
    54. zingchart.exec('demo-chart', 'setdata', {
    55. 'data': {
    56. 'type': 'bar',
    57. 'series': [{
    58. 'values': [69, 68, 54, 48, 70, 74, 98, 70, 72, 68, 49, 69]
    59. }]
    60. }
    61. });
    62. });
    63.  
    64. reset.addEventListener('click', function() {
    65. zingchart.exec('demo-chart', 'reload');
    66. });
    67.  
    68.  
    69. zingchart.render({
    70. id: 'demo-chart',
    71. data: myConfig,
    72. height: 400,
    73. width: '100%'
    74. });
    75. </script>
    76. </body>
    77.  
    78. </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='https://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='reset'>Reset</button>
    16. <button class='btn btn-info' id='demo1'>Run Demo 1</button>
    17. <pre id='output'></pre>
    18. </body>
    19.  
    20. </html>
    1. html,
    2. body {
    3. height: 100%;
    4. width: 100%;
    5. margin: 0;
    6. padding: 0;
    7. }
    8.  
    9. .chart--container {
    10. height: 100%;
    11. width: 100%;
    12. min-height: 150px;
    13. }
    14.  
    15. .zc-ref {
    16. display: none;
    17. }
    1. var myConfig = {
    2. 'type': 'line',
    3. 'legend': {},
    4. 'series': [{
    5. 'values': [11, 26, 7, 44, 11]
    6. },
    7. {
    8. 'values': [42, 13, 21, 15, 33]
    9. }
    10. ]
    11. };
    12. zingchart.setdata = function(p) {
    13. zcdocs.demos.dump('setdata', p);
    14. }
    15. demo1.addEventListener('click', function() {
    16. zingchart.exec('demo-chart', 'setdata', {
    17. 'data': {
    18. 'type': 'bar',
    19. 'series': [{
    20. 'values': [69, 68, 54, 48, 70, 74, 98, 70, 72, 68, 49, 69]
    21. }]
    22. }
    23. });
    24. });
    25.  
    26. reset.addEventListener('click', function() {
    27. zingchart.exec('demo-chart', 'reload');
    28. });
    29.  
    30.  
    31. zingchart.render({
    32. id: 'demo-chart',
    33. data: myConfig,
    34. height: 400,
    35. width: '100%'
    36. });