• Edit
  • Download
    1. <!doctype html>
    2. <html class="zc-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. <style>
    9. .zc-body {
    10. background: #fff;
    11. }
    12.  
    13. .chart--container {
    14. height: 100%;
    15. width: 100%;
    16. min-height: 650px;
    17. }
    18.  
    19. .zc-ref {
    20. display: none;
    21. }
    22. </style>
    23. </head>
    24.  
    25. <body class="zc-body">
    26. <div id="myChart" class="chart--container">
    27. <a href="https://www.zingchart.com/" rel="noopener" class="zc-ref">Powered by ZingChart</a>
    28. </div>
    29.  
    30. <script>
    31. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"]; // full ZingChart schema can be found here:
    32. // https://www.zingchart.com/docs/api/json-configuration/
    33. let palette = [
    34. '#F6842E', '#FBAC33', '#8AC340', '#46B863', '#41BC9F', '#29C2EC',
    35. '#387EC3', '#5253A3', '#764199', '#962871', '#C87F8A', '#F14F42'
    36. ];
    37.  
    38. let transforms = [
    39. [8, '0%', 'none', 'fixed=60%;50%'],
    40. [8, '40%', 'none', 'fixed=60%;50%'],
    41. [8, '0%', 'flat', 'fixed=60%;50%'],
    42. [8, '40%', 'flat', 'fixed=50%;50%'],
    43. [8, '0%', 'fold=20', 'fixed=50%;50%'],
    44. [8, '40%', 'fold=20', 'fixed=35%;50%'],
    45. [5, '40%', 'callout=8', 'fixed=50%;50%'],
    46. [5, '60%', 'flow=10', 'fixed=50%;60%'],
    47. [5, '60%', 'flow=-99', 'fixed=50%;40%'],
    48. [8, '0%', 'bite=15', 'fixed=50%;50%'],
    49. [8, '40%', 'bite=15', 'fixed=40%;50%'],
    50. [4, '0%', 'droplet', 'fixed=70%;50%']
    51. ];
    52.  
    53. let chartConfig = {
    54. graphset: []
    55. };
    56.  
    57. for (let r = 0; r < 3; r++) {
    58. for (let c = 0; c < 4; c++) {
    59. let idx = r * 4 + c;
    60. if (transforms[idx]) {
    61. let gdata = {
    62. type: 'pie',
    63. width: '200px',
    64. height: '200px',
    65. x: `${c*200}px`,
    66. y: `${r*200}px`,
    67. title: {
    68. text: 'pieTransform:' + transforms[idx][2],
    69. fontSize: '11px'
    70. },
    71. plot: {
    72. borderWidth: '1px',
    73. borderColor: '#fff',
    74. borderAlpha: 0.2,
    75. // PIE TRANSFORM ATTRIBUTES HERE
    76. slice: transforms[idx][1],
    77. pieTransform: transforms[idx][2],
    78. hoverState: {
    79. visible: false
    80. },
    81. tooltip: {
    82. text: 'Pie #%plot-index'
    83. },
    84. valueBox: {
    85. placement: transforms[idx][3],
    86. fontSize: '11px',
    87. text: '#%plot-index'
    88. }
    89. },
    90. plotarea: {
    91. margin: '15px 5px 5px 5px'
    92. },
    93. series: []
    94. };
    95. for (let i = 0; i < transforms[idx][0]; i++) {
    96. gdata.series.push({
    97. values: [1],
    98. backgroundColor: palette[i]
    99. });
    100. }
    101. chartConfig.graphset.push(gdata);
    102. }
    103. }
    104. }
    105.  
    106. zingchart.render({
    107. id: 'myChart',
    108. width: '100%',
    109. height: '100%',
    110. data: chartConfig
    111. });
    112. </script>
    113. </body>
    114.  
    115. </html>
    1. <!doctype html>
    2. <html class="zc-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. </head>
    9.  
    10. <body class="zc-body">
    11. <div id="myChart" class="chart--container">
    12. <a href="https://www.zingchart.com/" rel="noopener" class="zc-ref">Powered by ZingChart</a>
    13. </div>
    14.  
    15. </body>
    16.  
    17. </html>
    1. .zc-body {
    2. background: #fff;
    3. }
    4.  
    5. .chart--container {
    6. height: 100%;
    7. width: 100%;
    8. min-height: 650px;
    9. }
    10.  
    11. .zc-ref {
    12. display: none;
    13. }
    1. // full ZingChart schema can be found here:
    2. // https://www.zingchart.com/docs/api/json-configuration/
    3. let palette = [
    4. '#F6842E', '#FBAC33', '#8AC340', '#46B863', '#41BC9F', '#29C2EC',
    5. '#387EC3', '#5253A3', '#764199', '#962871', '#C87F8A', '#F14F42'
    6. ];
    7.  
    8. let transforms = [
    9. [8, '0%', 'none', 'fixed=60%;50%'],
    10. [8, '40%', 'none', 'fixed=60%;50%'],
    11. [8, '0%', 'flat', 'fixed=60%;50%'],
    12. [8, '40%', 'flat', 'fixed=50%;50%'],
    13. [8, '0%', 'fold=20', 'fixed=50%;50%'],
    14. [8, '40%', 'fold=20', 'fixed=35%;50%'],
    15. [5, '40%', 'callout=8', 'fixed=50%;50%'],
    16. [5, '60%', 'flow=10', 'fixed=50%;60%'],
    17. [5, '60%', 'flow=-99', 'fixed=50%;40%'],
    18. [8, '0%', 'bite=15', 'fixed=50%;50%'],
    19. [8, '40%', 'bite=15', 'fixed=40%;50%'],
    20. [4, '0%', 'droplet', 'fixed=70%;50%']
    21. ];
    22.  
    23. let chartConfig = {
    24. graphset: []
    25. };
    26.  
    27. for (let r = 0; r < 3; r++) {
    28. for (let c = 0; c < 4; c++) {
    29. let idx = r * 4 + c;
    30. if (transforms[idx]) {
    31. let gdata = {
    32. type: 'pie',
    33. width: '200px',
    34. height: '200px',
    35. x: `${c*200}px`,
    36. y: `${r*200}px`,
    37. title: {
    38. text: 'pieTransform:' + transforms[idx][2],
    39. fontSize: '11px'
    40. },
    41. plot: {
    42. borderWidth: '1px',
    43. borderColor: '#fff',
    44. borderAlpha: 0.2,
    45. // PIE TRANSFORM ATTRIBUTES HERE
    46. slice: transforms[idx][1],
    47. pieTransform: transforms[idx][2],
    48. hoverState: {
    49. visible: false
    50. },
    51. tooltip: {
    52. text: 'Pie #%plot-index'
    53. },
    54. valueBox: {
    55. placement: transforms[idx][3],
    56. fontSize: '11px',
    57. text: '#%plot-index'
    58. }
    59. },
    60. plotarea: {
    61. margin: '15px 5px 5px 5px'
    62. },
    63. series: []
    64. };
    65. for (let i = 0; i < transforms[idx][0]; i++) {
    66. gdata.series.push({
    67. values: [1],
    68. backgroundColor: palette[i]
    69. });
    70. }
    71. chartConfig.graphset.push(gdata);
    72. }
    73. }
    74. }
    75.  
    76. zingchart.render({
    77. id: 'myChart',
    78. width: '100%',
    79. height: '100%',
    80. data: chartConfig
    81. });