• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. <style>
    10. html,
    11. body {
    12. height: 100%;
    13. width: 100%;
    14. margin: 0;
    15. padding: 0;
    16. }
    17.  
    18. #myChart {
    19. height: 100%;
    20. width: 100%;
    21. min-height: 150px;
    22. }
    23.  
    24. .zc-ref {
    25. display: none;
    26. }
    27. </style>
    28. </head>
    29.  
    30. <body>
    31. <div id="myChart"><a class="zc-ref" href="https://www.zingchart.com">Powered by ZingChart</a></div>
    32. <script>
    33. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    34. let chartConfig = {
    35. type: 'navpie',
    36. options: {
    37. threshold: '20%',
    38. others: {
    39. text: 'Others',
    40. backgroundColor: '#999 #333'
    41. },
    42. back: {
    43. backgroundColor: '#47a',
    44. border: '3px solid #47a',
    45. borderRadius: 9,
    46. color: '#fff',
    47. fontWeight: 'bold',
    48. fontSize: 12,
    49. padding: 10,
    50. shadow: true,
    51. shadowAlpha: 0.5,
    52.  
    53. tooltip: {
    54. text: 'Back to main chart',
    55.  
    56. backgroundColor: '#f90',
    57. borderColor: '#f60',
    58. borderRadius: -5,
    59. borderWidth: 2,
    60. callout: true,
    61. calloutHeight: 20,
    62. calloutPosition: 'bottom',
    63. calloutWidth: 0,
    64. padding: 10,
    65. shadow: true,
    66. calloutTip: {
    67. type: 'circle',
    68. backgroundColor: '#fff',
    69. borderWidth: 2,
    70. borderColor: '#f60',
    71. size: 5,
    72. offsetY: 0
    73. }
    74. },
    75.  
    76. mediaRules: [{
    77. maxWidth: 400,
    78. backgroundColor: 'red'
    79. }],
    80. },
    81. },
    82. series: [{
    83. values: [69],
    84. text: 'Apple'
    85. },
    86. {
    87. values: [51],
    88. text: 'Microsoft'
    89. },
    90. {
    91. values: [42],
    92. text: 'Oracle'
    93. },
    94. {
    95. values: [20],
    96. text: 'Dell'
    97. },
    98. {
    99. values: [19],
    100. text: 'Amazon'
    101. },
    102. ]
    103. }
    104.  
    105. zingchart.render({
    106. id: 'myChart',
    107. data: chartConfig,
    108. height: '100%',
    109. width: '100%'
    110. });
    111. </script>
    112. </body>
    113.  
    114. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. </head>
    10.  
    11. <body>
    12. <div id="myChart"><a class="zc-ref" href="https://www.zingchart.com">Powered by ZingChart</a></div>
    13. </body>
    14.  
    15. </html>
    1. html,
    2. body {
    3. height: 100%;
    4. width: 100%;
    5. margin: 0;
    6. padding: 0;
    7. }
    8.  
    9. #myChart {
    10. height: 100%;
    11. width: 100%;
    12. min-height: 150px;
    13. }
    14.  
    15. .zc-ref {
    16. display: none;
    17. }
    1. let chartConfig = {
    2. type: 'navpie',
    3. options: {
    4. threshold: '20%',
    5. others: {
    6. text: 'Others',
    7. backgroundColor: '#999 #333'
    8. },
    9. back: {
    10. backgroundColor: '#47a',
    11. border: '3px solid #47a',
    12. borderRadius: 9,
    13. color: '#fff',
    14. fontWeight: 'bold',
    15. fontSize: 12,
    16. padding: 10,
    17. shadow: true,
    18. shadowAlpha: 0.5,
    19.  
    20. tooltip: {
    21. text: 'Back to main chart',
    22.  
    23. backgroundColor: '#f90',
    24. borderColor: '#f60',
    25. borderRadius: -5,
    26. borderWidth: 2,
    27. callout: true,
    28. calloutHeight: 20,
    29. calloutPosition: 'bottom',
    30. calloutWidth: 0,
    31. padding: 10,
    32. shadow: true,
    33. calloutTip: {
    34. type: 'circle',
    35. backgroundColor: '#fff',
    36. borderWidth: 2,
    37. borderColor: '#f60',
    38. size: 5,
    39. offsetY: 0
    40. }
    41. },
    42.  
    43. mediaRules: [{
    44. maxWidth: 400,
    45. backgroundColor: 'red'
    46. }],
    47. },
    48. },
    49. series: [{
    50. values: [69],
    51. text: 'Apple'
    52. },
    53. {
    54. values: [51],
    55. text: 'Microsoft'
    56. },
    57. {
    58. values: [42],
    59. text: 'Oracle'
    60. },
    61. {
    62. values: [20],
    63. text: 'Dell'
    64. },
    65. {
    66. values: [19],
    67. text: 'Amazon'
    68. },
    69. ]
    70. }
    71.  
    72. zingchart.render({
    73. id: 'myChart',
    74. data: chartConfig,
    75. height: '100%',
    76. width: '100%'
    77. });