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