• 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='myChart1'></div>
    14. <div id='myChart2'></div>
    15. <script>
    16. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    17. window.feed = function(callback, oGraphInfo) {
    18. //console.log(oGraphInfo)
    19. var tick = {};
    20. if (oGraphInfo.id === "myChart1") {
    21. tick.plot0 = Math.floor(Math.random() * 3);
    22. tick.plot1 = Math.floor(Math.random() * 3);
    23. } else {
    24. tick.plot0 = Math.floor(Math.random() * 10);
    25. tick.plot1 = Math.floor(Math.random() * 15);
    26. }
    27. callback(JSON.stringify(tick));
    28. };
    29.  
    30.  
    31. var myConfig = {
    32. type: "line",
    33. title: {
    34. text: 'JS Feed'
    35. },
    36. plot: {
    37. aspect: "spline"
    38. },
    39. scaleY: {
    40. values: '-1:15:1'
    41. },
    42. backgroundColor: "transparent",
    43. refresh: {
    44. type: "feed",
    45. transport: "js",
    46. url: "feed()",
    47. maxTicks: 20,
    48. interval: 500,
    49. adjustScale: true,
    50. resetTimeout: 1000
    51. },
    52. series: [{
    53. values: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    54. },
    55. {
    56. values: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
    57. }
    58. ]
    59. };
    60.  
    61. zingchart.render({
    62. id: 'myChart1',
    63. data: myConfig,
    64. height: 400,
    65. width: '100%'
    66. });
    67.  
    68. zingchart.render({
    69. id: 'myChart2',
    70. data: myConfig,
    71. height: 400,
    72. width: '100%'
    73. });
    74. </script>
    75. </body>
    76.  
    77. </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='myChart1'></div>
    13. <div id='myChart2'></div>
    14. </body>
    15.  
    16. </html>
    1.  
    1. window.feed = function(callback, oGraphInfo) {
    2. //console.log(oGraphInfo)
    3. var tick = {};
    4. if (oGraphInfo.id === "myChart1") {
    5. tick.plot0 = Math.floor(Math.random() * 3);
    6. tick.plot1 = Math.floor(Math.random() * 3);
    7. } else {
    8. tick.plot0 = Math.floor(Math.random() * 10);
    9. tick.plot1 = Math.floor(Math.random() * 15);
    10. }
    11. callback(JSON.stringify(tick));
    12. };
    13.  
    14.  
    15. var myConfig = {
    16. type: "line",
    17. title: {
    18. text: 'JS Feed'
    19. },
    20. plot: {
    21. aspect: "spline"
    22. },
    23. scaleY: {
    24. values: '-1:15:1'
    25. },
    26. backgroundColor: "transparent",
    27. refresh: {
    28. type: "feed",
    29. transport: "js",
    30. url: "feed()",
    31. maxTicks: 20,
    32. interval: 500,
    33. adjustScale: true,
    34. resetTimeout: 1000
    35. },
    36. series: [{
    37. values: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    38. },
    39. {
    40. values: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
    41. }
    42. ]
    43. };
    44.  
    45. zingchart.render({
    46. id: 'myChart1',
    47. data: myConfig,
    48. height: 400,
    49. width: '100%'
    50. });
    51.  
    52. zingchart.render({
    53. id: 'myChart2',
    54. data: myConfig,
    55. height: 400,
    56. width: '100%'
    57. });