• 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-info' id='demo1'>Add To Context Menu</button>
    17. <button class='btn btn-info' id='demo2'>Add To Context Menu2</button>
    18. <button class='btn btn-info' id='reload'>Reload</button>
    19. <script>
    20. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    21. var myConfig = {
    22. 'type': 'line',
    23. title: {
    24.  
    25. },
    26. 'series': [{
    27. 'values': [11, 26, 7, 44, 19]
    28. }]
    29. };
    30.  
    31. zingchart.render({
    32. id: 'demo-chart',
    33. data: myConfig,
    34. height: 400,
    35. width: '100%'
    36. });
    37.  
    38. window.myNewFunc = function() {
    39. alert("Hi I'm A New Function");
    40. }
    41.  
    42. demo1.addEventListener('click', function() {
    43. let output = zingchart.exec('demo-chart', 'addmenuitem', {
    44. 'text': 'Special Alert',
    45. 'function': 'myNewFunc()',
    46. 'order': 101
    47. });
    48. zcdocs.demos.dump('addmenuitem', output);
    49. });
    50.  
    51. demo2.addEventListener('click', function() {
    52. let output = zingchart.exec('demo-chart', 'addmenuitem', {
    53. 'text': 'Special Alert2',
    54. 'function': 'myNewFunc()',
    55. 'order': 100
    56. });
    57. zcdocs.demos.dump('addmenuitem', output);
    58. });
    59.  
    60. reload.addEventListener('click', function() {
    61. zingchart.exec('demo-chart', 'reload');
    62. });
    63. </script>
    64. </body>
    65.  
    66. </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-info' id='demo1'>Add To Context Menu</button>
    16. <button class='btn btn-info' id='demo2'>Add To Context Menu2</button>
    17. <button class='btn btn-info' id='reload'>Reload</button>
    18. </body>
    19.  
    20. </html>
    1.  
    1. var myConfig = {
    2. 'type': 'line',
    3. title: {
    4.  
    5. },
    6. 'series': [{
    7. 'values': [11, 26, 7, 44, 19]
    8. }]
    9. };
    10.  
    11. zingchart.render({
    12. id: 'demo-chart',
    13. data: myConfig,
    14. height: 400,
    15. width: '100%'
    16. });
    17.  
    18. window.myNewFunc = function() {
    19. alert("Hi I'm A New Function");
    20. }
    21.  
    22. demo1.addEventListener('click', function() {
    23. let output = zingchart.exec('demo-chart', 'addmenuitem', {
    24. 'text': 'Special Alert',
    25. 'function': 'myNewFunc()',
    26. 'order': 101
    27. });
    28. zcdocs.demos.dump('addmenuitem', output);
    29. });
    30.  
    31. demo2.addEventListener('click', function() {
    32. let output = zingchart.exec('demo-chart', 'addmenuitem', {
    33. 'text': 'Special Alert2',
    34. 'function': 'myNewFunc()',
    35. 'order': 100
    36. });
    37. zcdocs.demos.dump('addmenuitem', output);
    38. });
    39.  
    40. reload.addEventListener('click', function() {
    41. zingchart.exec('demo-chart', 'reload');
    42. });