• 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>
    10. html,
    11. body,
    12. #myChart {
    13. height: 100%;
    14. width: 100%;
    15. margin: 0;
    16. padding: 0;
    17. }
    18.  
    19. button {
    20. position: absolute;
    21. top: 10px;
    22. left: 10px;
    23. z-index: 1000;
    24. }
    25. </style>
    26. </head>
    27.  
    28. <body>
    29. <div id='myChart'>
    30. <button id="addplot">Add Plot</button>
    31. </div>
    32. <script>
    33. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    34. var myConfig = {
    35. type: 'bar',
    36. plot: {
    37. stacked: true,
    38. selectionMode: 'multiple',
    39. selectedState: {
    40. backgroundColor: '#FFC107'
    41. }
    42. },
    43. series: [{
    44. values: [35, 42, 67, 89, 25, 34, 67, 85]
    45. }]
    46. };
    47.  
    48. zingchart.render({
    49. id: 'myChart',
    50. data: myConfig,
    51. height: '100%',
    52. width: '100%'
    53. });
    54.  
    55. document.getElementById('addplot').addEventListener('click', function() {
    56. zingchart.exec('myChart', 'addplot', {
    57. data: {
    58. values: [35, 42, 67, 89, 25, 34, 67, 85]
    59. }
    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'>
    13. <button id="addplot">Add Plot</button>
    14. </div>
    15. </body>
    16.  
    17. </html>
    1. html,
    2. body,
    3. #myChart {
    4. height: 100%;
    5. width: 100%;
    6. margin: 0;
    7. padding: 0;
    8. }
    9.  
    10. button {
    11. position: absolute;
    12. top: 10px;
    13. left: 10px;
    14. z-index: 1000;
    15. }
    1. var myConfig = {
    2. type: 'bar',
    3. plot: {
    4. stacked: true,
    5. selectionMode: 'multiple',
    6. selectedState: {
    7. backgroundColor: '#FFC107'
    8. }
    9. },
    10. series: [{
    11. values: [35, 42, 67, 89, 25, 34, 67, 85]
    12. }]
    13. };
    14.  
    15. zingchart.render({
    16. id: 'myChart',
    17. data: myConfig,
    18. height: '100%',
    19. width: '100%'
    20. });
    21.  
    22. document.getElementById('addplot').addEventListener('click', function() {
    23. zingchart.exec('myChart', 'addplot', {
    24. data: {
    25. values: [35, 42, 67, 89, 25, 34, 67, 85]
    26. }
    27. });
    28. });