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