• 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. .chart--container {
    10. height: 100%;
    11. width: 100%;
    12. min-height: 530px;
    13. }
    14.  
    15. .zc-ref {
    16. display: none;
    17. }
    18. </style>
    19. </head>
    20.  
    21. <body class="zc-body">
    22. <div id="myChart" class="chart--container">
    23. <a href="https://www.zingchart.com/" rel="noopener" class="zc-ref">Powered by ZingChart</a>
    24. </div>
    25.  
    26. <script>
    27. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"]; // CHART CONFIG
    28. // -----------------------------
    29. let chartConfig = {
    30. type: 'nestedpie',
    31. title: {
    32. text: 'Animated Nested Pie Chart',
    33. },
    34. legend: {
    35. borderColor: 'gray',
    36. borderRadius: '5px',
    37. borderWidth: '1px',
    38. dragHandler: 'icon',
    39. header: {
    40. text: 'Ages',
    41. fontColor: 'purple',
    42. fontFamily: 'Georgia',
    43. fontSize: '12px',
    44. fontWeight: 'normal',
    45. },
    46. icon: {
    47. lineColor: 'orange',
    48. },
    49. item: {
    50. fontColor: 'black',
    51. fontFamily: 'Georgia',
    52. },
    53. lineStyle: 'dashdot',
    54. marker: {
    55. type: 'circle',
    56. },
    57. minimize: true,
    58. toggleAction: 'remove',
    59. },
    60. plot: {
    61. tooltip: {
    62. text: '%data-year Ages %t: %v',
    63. padding: '10%',
    64. alpha: 0.7,
    65. backgroundColor: 'white',
    66. borderColor: 'gray',
    67. borderRadius: '3px',
    68. borderWidth: '1px',
    69. fontColor: 'black',
    70. fontFamily: 'Georgia',
    71. fontSize: '12px',
    72. lineStyle: 'dashdot',
    73. textAlpha: 1,
    74. },
    75. valueBox: {
    76. text: '%data-year',
    77. fontColor: 'white',
    78. fontFamily: 'Georgia',
    79. fontSize: '12px',
    80. fontWeight: 'normal',
    81. rules: [{
    82. rule: '%p != 0',
    83. visible: false,
    84. }, ],
    85. },
    86. alpha: 0.8,
    87. animation: {
    88. effect: 'ANIMATION_EXPAND_LEFT',
    89. onLegendToggle: false,
    90. method: 'ANIMATION_BACK_EASE_OUT',
    91. sequence: 'ANIMATION_BY_PLOT',
    92. speed: 700,
    93. },
    94. borderColor: 'white',
    95. borderWidth: '1px',
    96. dataYear: ['2019', '2020', '2021'],
    97. shadow: false,
    98. sliceStart: '30%',
    99. },
    100. series: [{
    101. text: '0-18',
    102. values: [59, 55, 30],
    103. backgroundColor: 'orange red',
    104. tooltipText: 'Ages %t: %v',
    105. },
    106. {
    107. text: '19-30',
    108. values: [60, 50, 35],
    109. backgroundColor: 'yellow orange',
    110. },
    111. {
    112. text: '31-34',
    113. values: [50, 40, 30],
    114. backgroundColor: 'green blue',
    115. },
    116. {
    117. text: '46-64',
    118. values: [61, 59, 35],
    119. backgroundColor: 'blue purple',
    120. },
    121. {
    122. text: '65 and over',
    123. values: [65, 55, 45],
    124. backgroundColor: 'purple red',
    125. },
    126. ],
    127. };
    128.  
    129. // RENDER CHARTS
    130. // -----------------------------
    131. zingchart.render({
    132. id: 'myChart',
    133. data: chartConfig,
    134. });
    135. </script>
    136. </body>
    137.  
    138. </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. .chart--container {
    2. height: 100%;
    3. width: 100%;
    4. min-height: 530px;
    5. }
    6.  
    7. .zc-ref {
    8. display: none;
    9. }
    1. // CHART CONFIG
    2. // -----------------------------
    3. let chartConfig = {
    4. type: 'nestedpie',
    5. title: {
    6. text: 'Animated Nested Pie Chart',
    7. },
    8. legend: {
    9. borderColor: 'gray',
    10. borderRadius: '5px',
    11. borderWidth: '1px',
    12. dragHandler: 'icon',
    13. header: {
    14. text: 'Ages',
    15. fontColor: 'purple',
    16. fontFamily: 'Georgia',
    17. fontSize: '12px',
    18. fontWeight: 'normal',
    19. },
    20. icon: {
    21. lineColor: 'orange',
    22. },
    23. item: {
    24. fontColor: 'black',
    25. fontFamily: 'Georgia',
    26. },
    27. lineStyle: 'dashdot',
    28. marker: {
    29. type: 'circle',
    30. },
    31. minimize: true,
    32. toggleAction: 'remove',
    33. },
    34. plot: {
    35. tooltip: {
    36. text: '%data-year Ages %t: %v',
    37. padding: '10%',
    38. alpha: 0.7,
    39. backgroundColor: 'white',
    40. borderColor: 'gray',
    41. borderRadius: '3px',
    42. borderWidth: '1px',
    43. fontColor: 'black',
    44. fontFamily: 'Georgia',
    45. fontSize: '12px',
    46. lineStyle: 'dashdot',
    47. textAlpha: 1,
    48. },
    49. valueBox: {
    50. text: '%data-year',
    51. fontColor: 'white',
    52. fontFamily: 'Georgia',
    53. fontSize: '12px',
    54. fontWeight: 'normal',
    55. rules: [{
    56. rule: '%p != 0',
    57. visible: false,
    58. }, ],
    59. },
    60. alpha: 0.8,
    61. animation: {
    62. effect: 'ANIMATION_EXPAND_LEFT',
    63. onLegendToggle: false,
    64. method: 'ANIMATION_BACK_EASE_OUT',
    65. sequence: 'ANIMATION_BY_PLOT',
    66. speed: 700,
    67. },
    68. borderColor: 'white',
    69. borderWidth: '1px',
    70. dataYear: ['2019', '2020', '2021'],
    71. shadow: false,
    72. sliceStart: '30%',
    73. },
    74. series: [{
    75. text: '0-18',
    76. values: [59, 55, 30],
    77. backgroundColor: 'orange red',
    78. tooltipText: 'Ages %t: %v',
    79. },
    80. {
    81. text: '19-30',
    82. values: [60, 50, 35],
    83. backgroundColor: 'yellow orange',
    84. },
    85. {
    86. text: '31-34',
    87. values: [50, 40, 30],
    88. backgroundColor: 'green blue',
    89. },
    90. {
    91. text: '46-64',
    92. values: [61, 59, 35],
    93. backgroundColor: 'blue purple',
    94. },
    95. {
    96. text: '65 and over',
    97. values: [65, 55, 45],
    98. backgroundColor: 'purple red',
    99. },
    100. ],
    101. };
    102.  
    103. // RENDER CHARTS
    104. // -----------------------------
    105. zingchart.render({
    106. id: 'myChart',
    107. data: chartConfig,
    108. });