• 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'>Run Demo 1</button>
    18. <button class='btn btn-info' id='demo2'>Run Demo 2</button>
    19. <pre id='output'></pre>
    20. <script>
    21. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    22. var myConfig = {
    23. 'type': 'line',
    24. 'series': [{
    25. 'values': [11, 26, 7, 44, 11]
    26. }]
    27. };
    28.  
    29. zingchart.render({
    30. id: 'demo-chart',
    31. data: myConfig,
    32. height: 400,
    33. width: '100%'
    34. });
    35.  
    36. demo1.addEventListener('click', function() {
    37. let output = zingchart.exec('demo-chart', 'addobject', {
    38. 'type': 'label',
    39. 'data': {
    40. 'x': zcdocs.utils.rvalue(100, 400),
    41. 'y': zcdocs.utils.rvalue(50, 300),
    42. 'text': 'Label',
    43. 'background-color': '#f90',
    44. 'padding': 5
    45. }
    46. });
    47. zcdocs.demos.dump('addobject', output);
    48. });
    49. demo2.addEventListener('click', function() {
    50. let output = zingchart.exec('demo-chart', 'addobject', {
    51. 'type': 'shape',
    52. 'data': [{
    53. 'x': zcdocs.utils.rvalue(100, 400),
    54. 'y': zcdocs.utils.rvalue(50, 300),
    55. 'type': 'circle',
    56. 'size': zcdocs.utils.rvalue(10, 20),
    57. 'label': {
    58. 'text': 'Shape 1'
    59. },
    60. 'background-color': '#f09'
    61. },
    62. {
    63. 'x': zcdocs.utils.rvalue(100, 400),
    64. 'y': zcdocs.utils.rvalue(50, 300),
    65. 'type': 'star5',
    66. 'size': zcdocs.utils.rvalue(10, 20),
    67. 'label': {
    68. 'text': 'Shape 2'
    69. },
    70. 'background-color': '#0f9'
    71. }
    72. ]
    73. });
    74. zcdocs.demos.dump('addobject', output);
    75. });
    76. reload.addEventListener('click', function() {
    77. let output = zingchart.exec('demo-chart', 'reload');
    78. zcdocs.demos.dump('getrules', output);
    79. });
    80. </script>
    81. </body>
    82.  
    83. </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'>Run Demo 1</button>
    17. <button class='btn btn-info' id='demo2'>Run Demo 2</button>
    18. <pre id='output'></pre>
    19. </body>
    20.  
    21. </html>
    1.  
    1. var myConfig = {
    2. 'type': 'line',
    3. 'series': [{
    4. 'values': [11, 26, 7, 44, 11]
    5. }]
    6. };
    7.  
    8. zingchart.render({
    9. id: 'demo-chart',
    10. data: myConfig,
    11. height: 400,
    12. width: '100%'
    13. });
    14.  
    15. demo1.addEventListener('click', function() {
    16. let output = zingchart.exec('demo-chart', 'addobject', {
    17. 'type': 'label',
    18. 'data': {
    19. 'x': zcdocs.utils.rvalue(100, 400),
    20. 'y': zcdocs.utils.rvalue(50, 300),
    21. 'text': 'Label',
    22. 'background-color': '#f90',
    23. 'padding': 5
    24. }
    25. });
    26. zcdocs.demos.dump('addobject', output);
    27. });
    28. demo2.addEventListener('click', function() {
    29. let output = zingchart.exec('demo-chart', 'addobject', {
    30. 'type': 'shape',
    31. 'data': [{
    32. 'x': zcdocs.utils.rvalue(100, 400),
    33. 'y': zcdocs.utils.rvalue(50, 300),
    34. 'type': 'circle',
    35. 'size': zcdocs.utils.rvalue(10, 20),
    36. 'label': {
    37. 'text': 'Shape 1'
    38. },
    39. 'background-color': '#f09'
    40. },
    41. {
    42. 'x': zcdocs.utils.rvalue(100, 400),
    43. 'y': zcdocs.utils.rvalue(50, 300),
    44. 'type': 'star5',
    45. 'size': zcdocs.utils.rvalue(10, 20),
    46. 'label': {
    47. 'text': 'Shape 2'
    48. },
    49. 'background-color': '#0f9'
    50. }
    51. ]
    52. });
    53. zcdocs.demos.dump('addobject', output);
    54. });
    55. reload.addEventListener('click', function() {
    56. let output = zingchart.exec('demo-chart', 'reload');
    57. zcdocs.demos.dump('getrules', output);
    58. });