• 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. var myConfig = {
    17. type: "pie",
    18. title: {
    19. text: 'Click On A Label'
    20. },
    21. plot: {
    22. valueBox: {
    23. placement: 'out',
    24. backgroundColor: 'black',
    25. width: 100,
    26. height: 100,
    27. flat: false // MOST IMPORTANT PART TO GET LABEL CLICK
    28. }
    29. },
    30. series: [{
    31. values: [59]
    32. },
    33. {
    34. values: [55]
    35. },
    36. {
    37. values: [30]
    38. },
    39. {
    40. values: [28]
    41. },
    42. {
    43. values: [15]
    44. }
    45. ]
    46. };
    47.  
    48. zingchart.render({
    49. id: 'myChart',
    50. data: myConfig,
    51. height: 400,
    52. width: "100%"
    53. });
    54.  
    55. zingchart.label_click = function(e) {
    56. console.log(e)
    57. zingchart.exec('myChart', 'clicknode', {
    58. plotindex: e.plotindex,
    59. nodeindex: e.nodeindex
    60. });
    61. }
    62. </script>
    63. </body>
    64.  
    65. </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. var myConfig = {
    2. type: "pie",
    3. title: {
    4. text: 'Click On A Label'
    5. },
    6. plot: {
    7. valueBox: {
    8. placement: 'out',
    9. backgroundColor: 'black',
    10. width: 100,
    11. height: 100,
    12. flat: false // MOST IMPORTANT PART TO GET LABEL CLICK
    13. }
    14. },
    15. series: [{
    16. values: [59]
    17. },
    18. {
    19. values: [55]
    20. },
    21. {
    22. values: [30]
    23. },
    24. {
    25. values: [28]
    26. },
    27. {
    28. values: [15]
    29. }
    30. ]
    31. };
    32.  
    33. zingchart.render({
    34. id: 'myChart',
    35. data: myConfig,
    36. height: 400,
    37. width: "100%"
    38. });
    39.  
    40. zingchart.label_click = function(e) {
    41. console.log(e)
    42. zingchart.exec('myChart', 'clicknode', {
    43. plotindex: e.plotindex,
    44. nodeindex: e.nodeindex
    45. });
    46. }