• 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. 'labels': [{
    28. 'id': 'label1',
    29. 'text': 'Label 1',
    30. 'x': 50,
    31. 'y': 50,
    32. 'background-color': '#f90',
    33. 'padding': 5
    34. }, {
    35. 'id': 'label2',
    36. 'text': 'Label 2',
    37. 'x': 150,
    38. 'y': 50,
    39. 'background-color': '#f09',
    40. 'padding': 5
    41. }],
    42. 'shapes': [{
    43. 'id': 'shape1',
    44. 'x': 100,
    45. 'y': 100,
    46. 'type': 'circle',
    47. 'size': 15,
    48. 'label': {
    49. 'text': 'Shape 1'
    50. },
    51. 'background-color': '#f09'
    52. },
    53. {
    54. 'id': 'shape2',
    55. 'x': 150,
    56. 'y': 100,
    57. 'type': 'star5',
    58. 'size': 20,
    59. 'label': {
    60. 'text': 'Shape 2'
    61. },
    62. 'background-color': '#0f9'
    63. }
    64. ]
    65. };
    66.  
    67. zingchart.render({
    68. id: 'demo-chart',
    69. data: myConfig,
    70. height: 400,
    71. width: '100%'
    72. });
    73.  
    74. demo1.addEventListener('click', function() {
    75. let output = zingchart.exec('demo-chart', 'removeobject', {
    76. 'type': 'label',
    77. 'id': 'label1'
    78. });
    79. zcdocs.demos.dump('removeobject', output);
    80. });
    81. demo2.addEventListener('click', function() {
    82. let output = zingchart.exec('demo-chart', 'removeobject', {
    83. 'type': 'shape',
    84. 'id': ['shape1', 'shape2']
    85. });
    86. zcdocs.demos.dump('removeobject', output);
    87. });
    88. reload.addEventListener('click', function() {
    89. let output = zingchart.exec('demo-chart', 'reload');
    90. zcdocs.demos.dump('reload', output);
    91. });
    92. </script>
    93. </body>
    94.  
    95. </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. 'labels': [{
    7. 'id': 'label1',
    8. 'text': 'Label 1',
    9. 'x': 50,
    10. 'y': 50,
    11. 'background-color': '#f90',
    12. 'padding': 5
    13. }, {
    14. 'id': 'label2',
    15. 'text': 'Label 2',
    16. 'x': 150,
    17. 'y': 50,
    18. 'background-color': '#f09',
    19. 'padding': 5
    20. }],
    21. 'shapes': [{
    22. 'id': 'shape1',
    23. 'x': 100,
    24. 'y': 100,
    25. 'type': 'circle',
    26. 'size': 15,
    27. 'label': {
    28. 'text': 'Shape 1'
    29. },
    30. 'background-color': '#f09'
    31. },
    32. {
    33. 'id': 'shape2',
    34. 'x': 150,
    35. 'y': 100,
    36. 'type': 'star5',
    37. 'size': 20,
    38. 'label': {
    39. 'text': 'Shape 2'
    40. },
    41. 'background-color': '#0f9'
    42. }
    43. ]
    44. };
    45.  
    46. zingchart.render({
    47. id: 'demo-chart',
    48. data: myConfig,
    49. height: 400,
    50. width: '100%'
    51. });
    52.  
    53. demo1.addEventListener('click', function() {
    54. let output = zingchart.exec('demo-chart', 'removeobject', {
    55. 'type': 'label',
    56. 'id': 'label1'
    57. });
    58. zcdocs.demos.dump('removeobject', output);
    59. });
    60. demo2.addEventListener('click', function() {
    61. let output = zingchart.exec('demo-chart', 'removeobject', {
    62. 'type': 'shape',
    63. 'id': ['shape1', 'shape2']
    64. });
    65. zcdocs.demos.dump('removeobject', output);
    66. });
    67. reload.addEventListener('click', function() {
    68. let output = zingchart.exec('demo-chart', 'reload');
    69. zcdocs.demos.dump('reload', output);
    70. });