• 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: 'pie',
    36. nav: {
    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. backgroundColor: '#f90',
    56. borderColor: '#f60',
    57. borderRadius: -5,
    58. borderWidth: 2,
    59. callout: true,
    60. calloutHeight: 30,
    61. calloutPosition: 'bottom',
    62. calloutWidth: 0,
    63. padding: 10,
    64. shadow: true,
    65. calloutTip: {
    66. type: 'circle',
    67. backgroundColor: '#fff',
    68. borderWidth: 2,
    69. borderColor: '#f60',
    70. size: 5,
    71. }
    72. },
    73.  
    74. mediaRules: [{
    75. maxWidth: 400,
    76. backgroundColor: 'red'
    77. }],
    78. },
    79. },
    80. series: [{
    81. values: [69],
    82. text: 'Apple'
    83. },
    84. {
    85. values: [51],
    86. text: 'Microsoft'
    87. },
    88. {
    89. values: [42],
    90. text: 'Oracle'
    91. },
    92. {
    93. values: [20],
    94. text: 'Dell'
    95. },
    96. {
    97. values: [19],
    98. text: 'Amazon'
    99. },
    100. ]
    101. }
    102.  
    103. zingchart.render({
    104. id: 'myChart',
    105. data: chartConfig,
    106. height: '100%',
    107. width: '100%'
    108. });
    109. </script>
    110. </body>
    111.  
    112. </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: 'pie',
    3. nav: {
    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. backgroundColor: '#f90',
    23. borderColor: '#f60',
    24. borderRadius: -5,
    25. borderWidth: 2,
    26. callout: true,
    27. calloutHeight: 30,
    28. calloutPosition: 'bottom',
    29. calloutWidth: 0,
    30. padding: 10,
    31. shadow: true,
    32. calloutTip: {
    33. type: 'circle',
    34. backgroundColor: '#fff',
    35. borderWidth: 2,
    36. borderColor: '#f60',
    37. size: 5,
    38. }
    39. },
    40.  
    41. mediaRules: [{
    42. maxWidth: 400,
    43. backgroundColor: 'red'
    44. }],
    45. },
    46. },
    47. series: [{
    48. values: [69],
    49. text: 'Apple'
    50. },
    51. {
    52. values: [51],
    53. text: 'Microsoft'
    54. },
    55. {
    56. values: [42],
    57. text: 'Oracle'
    58. },
    59. {
    60. values: [20],
    61. text: 'Dell'
    62. },
    63. {
    64. values: [19],
    65. text: 'Amazon'
    66. },
    67. ]
    68. }
    69.  
    70. zingchart.render({
    71. id: 'myChart',
    72. data: chartConfig,
    73. height: '100%',
    74. width: '100%'
    75. });