• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    8. <script nonce="undefined">
    9. zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/";
    10. </script>
    11.  
    12. <script nonce="undefined" src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous">
    13. </script>
    14.  
    15. <style>
    16. body {
    17. margin: 10px;
    18. padding: 10px;
    19. }
    20.  
    21. *,
    22. input,
    23. button,
    24. select,
    25. textarea,
    26. label {
    27. font-family: 'Lucida Sans Unicode', Monaco, Tahoma, Verdana, Arial;
    28. }
    29. </style>
    30. </head>
    31.  
    32. <body>
    33. <div id="myChart"></div>
    34. <script>
    35. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    36. let chartConfig = {
    37. type: 'radar',
    38. heatmap: {
    39. alpha: 1,
    40. async: false,
    41. blur: 20,
    42. brushType: 'circle',
    43. composite: true,
    44. graph: {
    45. keyScale: 'scale-k',
    46. valScale: 'scale-v'
    47. },
    48. size: '10px',
    49. tooltip: {
    50. decimals: 1
    51. },
    52. },
    53. plotarea: {
    54. margin: '10px'
    55. },
    56. scale: {
    57. sizeFactor: 0.9
    58. },
    59. scaleV: {
    60. values: '0:100:25',
    61. offsetStart: '40px',
    62. offsetEnd: 0
    63. },
    64. scaleK: {
    65. values: '0:355:5',
    66. aspect: 'circle',
    67. maxItems: 12,
    68. offset: 0,
    69. },
    70. tooltip: {},
    71. plot: {},
    72. series: [{}]
    73. };
    74.  
    75. let MAX = 100;
    76. let aData = [];
    77. zingchart.bind('myChart', 'load', function() {
    78. window.setInterval(function() {
    79. let l, k, v;
    80. let iMaxPoints = 512;
    81. if (aData.length === 0) {
    82. for (l = 0; l < iMaxPoints; l++) {
    83. k = 5 * Math.round(ZC._r_(0, 355) / 5);
    84. v = 5 * Math.round(ZC._r_(10, 100) / 5);
    85. aData.push([k, v, MAX * Math.random()]);
    86. }
    87. } else {
    88. for (l = aData.length - 1; l >= 0; l--) {
    89. aData[l][2] = Math.min(MAX, aData[l][2] - (MAX / 19) + (MAX / 20) * Math.random());
    90. if (aData[l][2] <= 0) {
    91. aData.splice(l, 1);
    92. }
    93. }
    94. for (l = 0; l < iMaxPoints - aData.length; l++) {
    95. k = 5 * Math.round(ZC._r_(0, 355) / 5);
    96. v = 5 * Math.round(ZC._r_(10, 100) / 5);
    97. aData.push([k, v, MAX * Math.random()]);
    98. }
    99. }
    100. zingchart.exec('myChart', 'heatmap.setdata', {
    101. data: aData
    102. });
    103. }, 15);
    104. });
    105.  
    106. zingchart.loadModules('heatmap', function() {
    107. zingchart.render({
    108. id: 'myChart',
    109. width: 500,
    110. height: 500,
    111. output: 'svg',
    112. data: chartConfig,
    113. modules: 'heatmap,color-scale'
    114. });
    115. });
    116. </script>
    117. </body>
    118.  
    119. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    8. <script>
    9. zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/";
    10. </script>
    11.  
    12. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous">
    13. </script>
    14.  
    15. </head>
    16.  
    17. <body>
    18. <div id="myChart"></div>
    19. </body>
    20.  
    21. </html>
    1. body {
    2. margin: 10px;
    3. padding: 10px;
    4. }
    5.  
    6. *,
    7. input,
    8. button,
    9. select,
    10. textarea,
    11. label {
    12. font-family: 'Lucida Sans Unicode', Monaco, Tahoma, Verdana, Arial;
    13. }
    1. let chartConfig = {
    2. type: 'radar',
    3. heatmap: {
    4. alpha: 1,
    5. async: false,
    6. blur: 20,
    7. brushType: 'circle',
    8. composite: true,
    9. graph: {
    10. keyScale: 'scale-k',
    11. valScale: 'scale-v'
    12. },
    13. size: '10px',
    14. tooltip: {
    15. decimals: 1
    16. },
    17. },
    18. plotarea: {
    19. margin: '10px'
    20. },
    21. scale: {
    22. sizeFactor: 0.9
    23. },
    24. scaleV: {
    25. values: '0:100:25',
    26. offsetStart: '40px',
    27. offsetEnd: 0
    28. },
    29. scaleK: {
    30. values: '0:355:5',
    31. aspect: 'circle',
    32. maxItems: 12,
    33. offset: 0,
    34. },
    35. tooltip: {},
    36. plot: {},
    37. series: [{}]
    38. };
    39.  
    40. let MAX = 100;
    41. let aData = [];
    42. zingchart.bind('myChart', 'load', function() {
    43. window.setInterval(function() {
    44. let l, k, v;
    45. let iMaxPoints = 512;
    46. if (aData.length === 0) {
    47. for (l = 0; l < iMaxPoints; l++) {
    48. k = 5 * Math.round(ZC._r_(0, 355) / 5);
    49. v = 5 * Math.round(ZC._r_(10, 100) / 5);
    50. aData.push([k, v, MAX * Math.random()]);
    51. }
    52. } else {
    53. for (l = aData.length - 1; l >= 0; l--) {
    54. aData[l][2] = Math.min(MAX, aData[l][2] - (MAX / 19) + (MAX / 20) * Math.random());
    55. if (aData[l][2] <= 0) {
    56. aData.splice(l, 1);
    57. }
    58. }
    59. for (l = 0; l < iMaxPoints - aData.length; l++) {
    60. k = 5 * Math.round(ZC._r_(0, 355) / 5);
    61. v = 5 * Math.round(ZC._r_(10, 100) / 5);
    62. aData.push([k, v, MAX * Math.random()]);
    63. }
    64. }
    65. zingchart.exec('myChart', 'heatmap.setdata', {
    66. data: aData
    67. });
    68. }, 15);
    69. });
    70.  
    71. zingchart.loadModules('heatmap', function() {
    72. zingchart.render({
    73. id: 'myChart',
    74. width: 500,
    75. height: 500,
    76. output: 'svg',
    77. data: chartConfig,
    78. modules: 'heatmap,color-scale'
    79. });
    80. });