• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. <style></style>
    10. </head>
    11.  
    12. <body>
    13. <div id='myChart'></div>
    14. <script>
    15. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    16. window.xalert = function(p) {
    17. alert("New custom item clicked!");
    18. };
    19.  
    20. var myConfig = {
    21. gui: {
    22. contextMenu: {
    23. customItems: [{
    24. text: "Click Me", //button text
    25. "function": "xalert(1)" //custom function to fire from button click
    26. }]
    27. }
    28. },
    29. graphset: [{
    30. type: "bar",
    31. subtitle: {
    32. text: "Right-click chart to view context menu"
    33. },
    34. series: [{
    35. values: [25, 17, 19, 35, 12, 15, 35, 39]
    36. },
    37. {
    38. values: [30, 35, 41, 28, 26, 18, 38, 40]
    39. }
    40. ]
    41. }]
    42. };
    43.  
    44. zingchart.render({
    45. id: 'myChart',
    46. data: myConfig,
    47. height: 400,
    48. width: '100%'
    49. });
    50. </script>
    51. </body>
    52.  
    53. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. </head>
    10.  
    11. <body>
    12. <div id='myChart'></div>
    13. </body>
    14.  
    15. </html>
    1.  
    1. window.xalert = function(p) {
    2. alert("New custom item clicked!");
    3. };
    4.  
    5. var myConfig = {
    6. gui: {
    7. contextMenu: {
    8. customItems: [{
    9. text: "Click Me", //button text
    10. "function": "xalert(1)" //custom function to fire from button click
    11. }]
    12. }
    13. },
    14. graphset: [{
    15. type: "bar",
    16. subtitle: {
    17. text: "Right-click chart to view context menu"
    18. },
    19. series: [{
    20. values: [25, 17, 19, 35, 12, 15, 35, 39]
    21. },
    22. {
    23. values: [30, 35, 41, 28, 26, 18, 38, 40]
    24. }
    25. ]
    26. }]
    27. };
    28.  
    29. zingchart.render({
    30. id: 'myChart',
    31. data: myConfig,
    32. height: 400,
    33. width: '100%'
    34. });