• 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></style>
    10. </head>
    11.  
    12. <body>
    13. <div id='myChart'></div>
    14. <script>
    15. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    16. var myConfig = {
    17. "type": "nestedpie",
    18. "title": {
    19. "text": "Legend"
    20. },
    21. "legend": {
    22. "border-width": 1,
    23. "border-color": "gray",
    24. "border-radius": "5px",
    25. "line-style": "dashdot",
    26. "header": {
    27. "text": "Ages",
    28. "font-family": "Georgia",
    29. "font-size": 12,
    30. "font-color": "purple",
    31. "font-weight": "normal"
    32. },
    33. "item": {
    34. "font-color": "black",
    35. "font-family": "Georgia"
    36. },
    37. "marker": {
    38. "type": "circle"
    39. },
    40. "toggle-action": "remove",
    41. "minimize": true,
    42. "draggable": true,
    43. "drag-handler": "icon",
    44. "icon": {
    45. "line-color": "orange"
    46. }
    47. },
    48. "plot": {
    49. "value-box": {
    50. "text": "%data-year",
    51. "font-color": "white",
    52. "font-family": "Georgia",
    53. "font-size": 12,
    54. "font-weight": "normal",
    55. "rules": [{
    56. "rule": "%p != 0",
    57. "visible": false
    58. }]
    59. },
    60. "data-year": ["2014", "2015", "2016"],
    61. "tooltip": {
    62. "text": "Ages %t: %v",
    63. "font-color": "black",
    64. "font-family": "Georgia",
    65. "font-size": 12,
    66. "background-color": "white",
    67. "border-width": 1,
    68. "border-color": "gray",
    69. "border-radius": "3px",
    70. "line-style": "dashdot",
    71. "padding": "10%",
    72. "text-alpha": 1,
    73. "alpha": 0.7
    74. },
    75.  
    76. "alpha": 0.8,
    77. "shadow": false,
    78. "border-width": 1,
    79. "border-color": "white",
    80. "slice-start": "30%",
    81. },
    82. "series": [{
    83. "values": [59, 55, 30],
    84. "background-color": "orange red",
    85. "text": "0-18"
    86. },
    87. {
    88. "values": [60, 50, 35],
    89. "background-color": "yellow orange",
    90. "text": "19-30"
    91. },
    92. {
    93. "values": [50, 40, 30],
    94. "background-color": "green blue",
    95. "text": "31-34"
    96. },
    97. {
    98. "values": [61, 59, 35],
    99. "background-color": "blue purple",
    100. "text": "46-64"
    101. },
    102. {
    103. "values": [65, 55, 45],
    104. "background-color": "purple red",
    105. "text": "65 and over"
    106. }
    107. ]
    108. };
    109.  
    110. zingchart.render({
    111. id: 'myChart',
    112. data: myConfig,
    113. height: 400,
    114. width: "100%"
    115. });
    116. </script>
    117. </body>
    118.  
    119. </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'></div>
    13. </body>
    14.  
    15. </html>
    1.  
    1. var myConfig = {
    2. "type": "nestedpie",
    3. "title": {
    4. "text": "Legend"
    5. },
    6. "legend": {
    7. "border-width": 1,
    8. "border-color": "gray",
    9. "border-radius": "5px",
    10. "line-style": "dashdot",
    11. "header": {
    12. "text": "Ages",
    13. "font-family": "Georgia",
    14. "font-size": 12,
    15. "font-color": "purple",
    16. "font-weight": "normal"
    17. },
    18. "item": {
    19. "font-color": "black",
    20. "font-family": "Georgia"
    21. },
    22. "marker": {
    23. "type": "circle"
    24. },
    25. "toggle-action": "remove",
    26. "minimize": true,
    27. "draggable": true,
    28. "drag-handler": "icon",
    29. "icon": {
    30. "line-color": "orange"
    31. }
    32. },
    33. "plot": {
    34. "value-box": {
    35. "text": "%data-year",
    36. "font-color": "white",
    37. "font-family": "Georgia",
    38. "font-size": 12,
    39. "font-weight": "normal",
    40. "rules": [{
    41. "rule": "%p != 0",
    42. "visible": false
    43. }]
    44. },
    45. "data-year": ["2014", "2015", "2016"],
    46. "tooltip": {
    47. "text": "Ages %t: %v",
    48. "font-color": "black",
    49. "font-family": "Georgia",
    50. "font-size": 12,
    51. "background-color": "white",
    52. "border-width": 1,
    53. "border-color": "gray",
    54. "border-radius": "3px",
    55. "line-style": "dashdot",
    56. "padding": "10%",
    57. "text-alpha": 1,
    58. "alpha": 0.7
    59. },
    60.  
    61. "alpha": 0.8,
    62. "shadow": false,
    63. "border-width": 1,
    64. "border-color": "white",
    65. "slice-start": "30%",
    66. },
    67. "series": [{
    68. "values": [59, 55, 30],
    69. "background-color": "orange red",
    70. "text": "0-18"
    71. },
    72. {
    73. "values": [60, 50, 35],
    74. "background-color": "yellow orange",
    75. "text": "19-30"
    76. },
    77. {
    78. "values": [50, 40, 30],
    79. "background-color": "green blue",
    80. "text": "31-34"
    81. },
    82. {
    83. "values": [61, 59, 35],
    84. "background-color": "blue purple",
    85. "text": "46-64"
    86. },
    87. {
    88. "values": [65, 55, 45],
    89. "background-color": "purple red",
    90. "text": "65 and over"
    91. }
    92. ]
    93. };
    94.  
    95. zingchart.render({
    96. id: 'myChart',
    97. data: myConfig,
    98. height: 400,
    99. width: "100%"
    100. });