• 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. <script nonce="undefined" src='//cdn.zingchart.com/modules/zingchart-api-annotations.min.js'></script>
    10.  
    11. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    12. <style></style>
    13. </head>
    14.  
    15. <body>
    16. <div id='demo-chart'></div>
    17.  
    18.  
    19. <button class='btn btn-info' id='demo1'>Add Note</button>
    20. <button class='btn btn-info' id='demo2'>Update Note</button>
    21. <button class='btn btn-info' id='demo3'>Remove Note</button>
    22. <pre id='output'></pre>
    23. <script>
    24. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    25. var myConfig = {
    26. 'graphset': [{
    27. 'type': 'bar',
    28. 'series': [{
    29. 'values': [75, 52, 55, 47, 60, 48]
    30. },
    31. {
    32. 'values': [51, 53, 47, 60, 48, 52]
    33. }
    34. ]
    35. }]
    36. };
    37.  
    38. zingchart.render({
    39. id: 'demo-chart',
    40. data: myConfig,
    41. height: 400,
    42. width: '100%'
    43. });
    44.  
    45. demo1.addEventListener('click', function() {
    46. let output = zingchart.exec('demo-chart', 'addnote', {
    47. id: 'note1',
    48. type: 'node',
    49. text: 'Note 1',
    50. plotindex: 0,
    51. nodeindex: 3
    52. });
    53. zcdocs.demos.dump('removenote', output);
    54. });
    55. demo2.addEventListener('click', function() {
    56. let output = zingchart.exec('demo-chart', 'updatenote', {
    57. id: 'note1',
    58. style: {
    59. 'background-color': '#f90'
    60. },
    61. type: 'scale',
    62. text: 'Note 1 (revision 1)',
    63. scaleindex: 4
    64. });
    65. zcdocs.demos.dump('removenote', output);
    66. });
    67. demo3.addEventListener('click', function() {
    68. let output = zingchart.exec('demo-chart', 'removenote', {
    69. id: 'note1'
    70. });
    71. zcdocs.demos.dump('removenote', output);
    72. });
    73. </script>
    74. </body>
    75.  
    76. </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. <script src='//cdn.zingchart.com/modules/zingchart-api-annotations.min.js'></script>
    10.  
    11. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    12. </head>
    13.  
    14. <body>
    15. <div id='demo-chart'></div>
    16.  
    17.  
    18. <button class='btn btn-info' id='demo1'>Add Note</button>
    19. <button class='btn btn-info' id='demo2'>Update Note</button>
    20. <button class='btn btn-info' id='demo3'>Remove Note</button>
    21. <pre id='output'></pre>
    22. </body>
    23.  
    24. </html>
    1.  
    1. var myConfig = {
    2. 'graphset': [{
    3. 'type': 'bar',
    4. 'series': [{
    5. 'values': [75, 52, 55, 47, 60, 48]
    6. },
    7. {
    8. 'values': [51, 53, 47, 60, 48, 52]
    9. }
    10. ]
    11. }]
    12. };
    13.  
    14. zingchart.render({
    15. id: 'demo-chart',
    16. data: myConfig,
    17. height: 400,
    18. width: '100%'
    19. });
    20.  
    21. demo1.addEventListener('click', function() {
    22. let output = zingchart.exec('demo-chart', 'addnote', {
    23. id: 'note1',
    24. type: 'node',
    25. text: 'Note 1',
    26. plotindex: 0,
    27. nodeindex: 3
    28. });
    29. zcdocs.demos.dump('removenote', output);
    30. });
    31. demo2.addEventListener('click', function() {
    32. let output = zingchart.exec('demo-chart', 'updatenote', {
    33. id: 'note1',
    34. style: {
    35. 'background-color': '#f90'
    36. },
    37. type: 'scale',
    38. text: 'Note 1 (revision 1)',
    39. scaleindex: 4
    40. });
    41. zcdocs.demos.dump('removenote', output);
    42. });
    43. demo3.addEventListener('click', function() {
    44. let output = zingchart.exec('demo-chart', 'removenote', {
    45. id: 'note1'
    46. });
    47. zcdocs.demos.dump('removenote', output);
    48. });