• 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. topState: {
    52. backgroundColor: 'red',
    53. offsetX: 10,
    54. offsetY: 10,
    55. },
    56. },
    57. },
    58. plotarea: {
    59. margin: '10px'
    60. },
    61. scale: {
    62. sizeFactor: 0.9
    63. },
    64. scaleV: {
    65. values: '0:100:25',
    66. offsetStart: '40px',
    67. offsetEnd: 0
    68. },
    69. scaleK: {
    70. values: '0:355:5',
    71. aspect: 'circle',
    72. maxItems: 12,
    73. offset: 0,
    74. },
    75. tooltip: {},
    76. plot: {},
    77. series: [{}]
    78. };
    79.  
    80. let MAX = 100;
    81. let aData = [];
    82. zingchart.bind('myChart', 'load', function() {
    83. window.setInterval(function() {
    84. let l, k, v;
    85. let iMaxPoints = 512;
    86. if (aData.length === 0) {
    87. for (l = 0; l < iMaxPoints; l++) {
    88. k = 5 * Math.round(ZC._r_(0, 355) / 5);
    89. v = 5 * Math.round(ZC._r_(10, 100) / 5);
    90. aData.push([k, v, MAX * Math.random()]);
    91. }
    92. } else {
    93. for (l = aData.length - 1; l >= 0; l--) {
    94. aData[l][2] = Math.min(MAX, aData[l][2] - (MAX / 19) + (MAX / 20) * Math.random());
    95. if (aData[l][2] <= 0) {
    96. aData.splice(l, 1);
    97. }
    98. }
    99. for (l = 0; l < iMaxPoints - aData.length; l++) {
    100. k = 5 * Math.round(ZC._r_(0, 355) / 5);
    101. v = 5 * Math.round(ZC._r_(10, 100) / 5);
    102. aData.push([k, v, MAX * Math.random()]);
    103. }
    104. }
    105. zingchart.exec('myChart', 'heatmap.setdata', {
    106. data: aData
    107. });
    108. }, 15);
    109. });
    110.  
    111. zingchart.loadModules('heatmap', function() {
    112. zingchart.render({
    113. id: 'myChart',
    114. width: 500,
    115. height: 500,
    116. output: 'svg',
    117. data: chartConfig,
    118. modules: 'heatmap,color-scale'
    119. });
    120. });
    121. </script>
    122. </body>
    123.  
    124. </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. topState: {
    17. backgroundColor: 'red',
    18. offsetX: 10,
    19. offsetY: 10,
    20. },
    21. },
    22. },
    23. plotarea: {
    24. margin: '10px'
    25. },
    26. scale: {
    27. sizeFactor: 0.9
    28. },
    29. scaleV: {
    30. values: '0:100:25',
    31. offsetStart: '40px',
    32. offsetEnd: 0
    33. },
    34. scaleK: {
    35. values: '0:355:5',
    36. aspect: 'circle',
    37. maxItems: 12,
    38. offset: 0,
    39. },
    40. tooltip: {},
    41. plot: {},
    42. series: [{}]
    43. };
    44.  
    45. let MAX = 100;
    46. let aData = [];
    47. zingchart.bind('myChart', 'load', function() {
    48. window.setInterval(function() {
    49. let l, k, v;
    50. let iMaxPoints = 512;
    51. if (aData.length === 0) {
    52. for (l = 0; l < iMaxPoints; l++) {
    53. k = 5 * Math.round(ZC._r_(0, 355) / 5);
    54. v = 5 * Math.round(ZC._r_(10, 100) / 5);
    55. aData.push([k, v, MAX * Math.random()]);
    56. }
    57. } else {
    58. for (l = aData.length - 1; l >= 0; l--) {
    59. aData[l][2] = Math.min(MAX, aData[l][2] - (MAX / 19) + (MAX / 20) * Math.random());
    60. if (aData[l][2] <= 0) {
    61. aData.splice(l, 1);
    62. }
    63. }
    64. for (l = 0; l < iMaxPoints - aData.length; l++) {
    65. k = 5 * Math.round(ZC._r_(0, 355) / 5);
    66. v = 5 * Math.round(ZC._r_(10, 100) / 5);
    67. aData.push([k, v, MAX * Math.random()]);
    68. }
    69. }
    70. zingchart.exec('myChart', 'heatmap.setdata', {
    71. data: aData
    72. });
    73. }, 15);
    74. });
    75.  
    76. zingchart.loadModules('heatmap', function() {
    77. zingchart.render({
    78. id: 'myChart',
    79. width: 500,
    80. height: 500,
    81. output: 'svg',
    82. data: chartConfig,
    83. modules: 'heatmap,color-scale'
    84. });
    85. });