• 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='reload'>Reset</button>
    17. <button class='btn btn-info' id='demo1'>Demo 1</button>
    18. <button class='btn btn-info' id='demo2'>Demo 2</button>
    19. <button class='btn btn-info' id='demo3'>Demo 3</button>
    20. <pre id='output'></pre>
    21. <script>
    22. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    23. var myConfig = {
    24. 'type': 'line',
    25. 'title': {
    26. 'text': 'Chart Title'
    27. },
    28. 'plotarea': {
    29. 'background-color': '#f90 #c63'
    30. },
    31. 'legend': {},
    32. 'series': [{
    33. 'values': [11, 26, 7, 44, 19]
    34. },
    35. {
    36. 'values': [18, 12, 27, 34, 21]
    37. }
    38. ]
    39. };
    40.  
    41. zingchart.render({
    42. id: 'demo-chart',
    43. data: myConfig,
    44. height: 400,
    45. width: '100%'
    46. });
    47.  
    48.  
    49. demo1.addEventListener('click', function() {
    50. let output = zingchart.exec('demo-chart', 'modify', {
    51. 'object': 'title',
    52. 'data': {
    53. 'text': 'A new title for the chart',
    54. 'background-color': '#060 #030'
    55. }
    56. });
    57. zcdocs.demos.dump('modify', output);
    58. });
    59. demo2.addEventListener('click', function() {
    60. let output = zingchart.exec('demo-chart', 'modify', {
    61. 'object': 'legend',
    62. 'data': {
    63. 'border-width': 2,
    64. 'border-color': '#06f',
    65. 'align': 'left',
    66. }
    67. });
    68. zcdocs.demos.dump('modify', output);
    69. });
    70. demo3.addEventListener('click', function() {
    71. let output = zingchart.exec('demo-chart', 'modify', {
    72. 'data': {
    73. 'plotarea': {
    74. 'border-width': 4,
    75. 'border-color': '#f60',
    76. 'background-color': '#c66 #63c'
    77. }
    78. }
    79. });
    80. zcdocs.demos.dump('modify', output);
    81. });
    82. reload.addEventListener('click', function() {
    83. zingchart.exec('demo-chart', 'reload');
    84. });
    85. </script>
    86. </body>
    87.  
    88. </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='reload'>Reset</button>
    16. <button class='btn btn-info' id='demo1'>Demo 1</button>
    17. <button class='btn btn-info' id='demo2'>Demo 2</button>
    18. <button class='btn btn-info' id='demo3'>Demo 3</button>
    19. <pre id='output'></pre>
    20. </body>
    21.  
    22. </html>
    1.  
    1. var myConfig = {
    2. 'type': 'line',
    3. 'title': {
    4. 'text': 'Chart Title'
    5. },
    6. 'plotarea': {
    7. 'background-color': '#f90 #c63'
    8. },
    9. 'legend': {},
    10. 'series': [{
    11. 'values': [11, 26, 7, 44, 19]
    12. },
    13. {
    14. 'values': [18, 12, 27, 34, 21]
    15. }
    16. ]
    17. };
    18.  
    19. zingchart.render({
    20. id: 'demo-chart',
    21. data: myConfig,
    22. height: 400,
    23. width: '100%'
    24. });
    25.  
    26.  
    27. demo1.addEventListener('click', function() {
    28. let output = zingchart.exec('demo-chart', 'modify', {
    29. 'object': 'title',
    30. 'data': {
    31. 'text': 'A new title for the chart',
    32. 'background-color': '#060 #030'
    33. }
    34. });
    35. zcdocs.demos.dump('modify', output);
    36. });
    37. demo2.addEventListener('click', function() {
    38. let output = zingchart.exec('demo-chart', 'modify', {
    39. 'object': 'legend',
    40. 'data': {
    41. 'border-width': 2,
    42. 'border-color': '#06f',
    43. 'align': 'left',
    44. }
    45. });
    46. zcdocs.demos.dump('modify', output);
    47. });
    48. demo3.addEventListener('click', function() {
    49. let output = zingchart.exec('demo-chart', 'modify', {
    50. 'data': {
    51. 'plotarea': {
    52. 'border-width': 4,
    53. 'border-color': '#f60',
    54. 'background-color': '#c66 #63c'
    55. }
    56. }
    57. });
    58. zcdocs.demos.dump('modify', output);
    59. });
    60. reload.addEventListener('click', function() {
    61. zingchart.exec('demo-chart', 'reload');
    62. });