• 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. <button id="ZCRemoveNodeKey">Remove Node</button>
    14. <div id='myChart'></div>
    15. <script>
    16. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    17. var myConfig = {
    18. "graphset": [{
    19. "type": "line",
    20. "title": {
    21. "text": "Value Pair Time Series"
    22. },
    23. "plot": {
    24. "line-width": 1
    25. },
    26. "scale-x": {
    27. "max-items": 10,
    28. "min-value": 1433282400000,
    29. "transform": {
    30. "type": "date",
    31. "all": "%d.%m.%Y<br />%H:%i",
    32. "item": {
    33. "visible": false
    34. }
    35. }
    36. },
    37. "series": [{
    38. "values": [
    39. [1433282400000, 25.68],
    40. [1433286000000, 26.41],
    41. [1433289600000, 26.52],
    42. [1433293200000, 26.23],
    43. [1433296800000, 25.77]
    44. ]
    45. },
    46. {
    47. "values": [
    48. [1433282400000, 76.32],
    49. [1433286000000, 76.42],
    50. [1433289600000, 75.94],
    51. [1433293200000, 75.27],
    52. [1433296800000, 74.24]
    53. ]
    54. }
    55. ]
    56. }]
    57. };
    58.  
    59. zingchart.render({
    60. id: 'myChart',
    61. data: myConfig,
    62. height: 400,
    63. width: '100%'
    64. });
    65.  
    66. var nodeKeyValues = [1433289600000, 1433282400000, 1433296800000, 1433286000000, 1433293200000];
    67.  
    68. Array.prototype.pop = function() {
    69. var returnValue = null;
    70. if (this.length !== 0) {
    71. returnValue = this[this.length - 1];
    72. this.length--;
    73. }
    74. return returnValue;
    75. }
    76.  
    77. document.getElementById('ZCRemoveNodeKey').addEventListener('click', function(e) {
    78.  
    79. zingchart.exec('myChart', 'removenode', {
    80. nodekeyvalue: nodeKeyValues.pop()
    81. })
    82. });
    83. </script>
    84. </body>
    85.  
    86. </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. <button id="ZCRemoveNodeKey">Remove Node</button>
    13. <div id='myChart'></div>
    14. </body>
    15.  
    16. </html>
    1.  
    1. var myConfig = {
    2. "graphset": [{
    3. "type": "line",
    4. "title": {
    5. "text": "Value Pair Time Series"
    6. },
    7. "plot": {
    8. "line-width": 1
    9. },
    10. "scale-x": {
    11. "max-items": 10,
    12. "min-value": 1433282400000,
    13. "transform": {
    14. "type": "date",
    15. "all": "%d.%m.%Y<br />%H:%i",
    16. "item": {
    17. "visible": false
    18. }
    19. }
    20. },
    21. "series": [{
    22. "values": [
    23. [1433282400000, 25.68],
    24. [1433286000000, 26.41],
    25. [1433289600000, 26.52],
    26. [1433293200000, 26.23],
    27. [1433296800000, 25.77]
    28. ]
    29. },
    30. {
    31. "values": [
    32. [1433282400000, 76.32],
    33. [1433286000000, 76.42],
    34. [1433289600000, 75.94],
    35. [1433293200000, 75.27],
    36. [1433296800000, 74.24]
    37. ]
    38. }
    39. ]
    40. }]
    41. };
    42.  
    43. zingchart.render({
    44. id: 'myChart',
    45. data: myConfig,
    46. height: 400,
    47. width: '100%'
    48. });
    49.  
    50. var nodeKeyValues = [1433289600000, 1433282400000, 1433296800000, 1433286000000, 1433293200000];
    51.  
    52. Array.prototype.pop = function() {
    53. var returnValue = null;
    54. if (this.length !== 0) {
    55. returnValue = this[this.length - 1];
    56. this.length--;
    57. }
    58. return returnValue;
    59. }
    60.  
    61. document.getElementById('ZCRemoveNodeKey').addEventListener('click', function(e) {
    62.  
    63. zingchart.exec('myChart', 'removenode', {
    64. nodekeyvalue: nodeKeyValues.pop()
    65. })
    66. });