• 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. let chartConfig = {
    17. "type": "bar",
    18. "title": {
    19. "text": "Legend Tooltips"
    20. },
    21. "legend": {
    22. "x": "25%",
    23. "y": "12%",
    24. "layout": "horizontal",
    25. "tooltip": { //Legend Tooltips
    26. "text": "The %plot-text population is %plot-description",
    27. "width": "20%",
    28. "height": "20%",
    29. "wrap-text": true,
    30. "padding": "5%",
    31. "background-color": "white",
    32. "font-color": "black",
    33. "font-family": "Georgia",
    34. "border-width": 1,
    35. "border-color": "gray",
    36. "border-radius": "5px",
    37. "sticky": true,
    38. "timeout": 10000
    39. }
    40. },
    41. "plotarea": {
    42. "margin-top": "25%"
    43. },
    44. "plot": {
    45. "stacked": true,
    46. "bar-width": "30%"
    47. },
    48. "scale-x": {
    49. "labels": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M"]
    50. },
    51. "scale-y": {
    52. "values": "0:200:50"
    53. },
    54. "series": [{
    55. "values": [64, 59, 55, 49, 39, 35, 31, 20, 16, 15, 9, 5, 4],
    56. "text": "0-18 years",
    57. "description": "depicted in blue."
    58. },
    59. {
    60. "values": [99, 90, 87, 70, 59, 51, 45, 39, 34, 25, 21, 9, 5],
    61. "text": "18-64 years",
    62. "description": "depicted in red."
    63. },
    64. {
    65. "values": [34, 30, 16, 15, 14, 12, 10, 9, 8, 7, 5, 4, 3],
    66. "text": "65 and over",
    67. "description": "depicted in green."
    68. }
    69. ]
    70. };
    71.  
    72. zingchart.render({
    73. id: 'myChart',
    74. data: chartConfig,
    75. height: 400,
    76. width: "100%"
    77. });
    78. </script>
    79. </body>
    80.  
    81. </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. let chartConfig = {
    2. "type": "bar",
    3. "title": {
    4. "text": "Legend Tooltips"
    5. },
    6. "legend": {
    7. "x": "25%",
    8. "y": "12%",
    9. "layout": "horizontal",
    10. "tooltip": { //Legend Tooltips
    11. "text": "The %plot-text population is %plot-description",
    12. "width": "20%",
    13. "height": "20%",
    14. "wrap-text": true,
    15. "padding": "5%",
    16. "background-color": "white",
    17. "font-color": "black",
    18. "font-family": "Georgia",
    19. "border-width": 1,
    20. "border-color": "gray",
    21. "border-radius": "5px",
    22. "sticky": true,
    23. "timeout": 10000
    24. }
    25. },
    26. "plotarea": {
    27. "margin-top": "25%"
    28. },
    29. "plot": {
    30. "stacked": true,
    31. "bar-width": "30%"
    32. },
    33. "scale-x": {
    34. "labels": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M"]
    35. },
    36. "scale-y": {
    37. "values": "0:200:50"
    38. },
    39. "series": [{
    40. "values": [64, 59, 55, 49, 39, 35, 31, 20, 16, 15, 9, 5, 4],
    41. "text": "0-18 years",
    42. "description": "depicted in blue."
    43. },
    44. {
    45. "values": [99, 90, 87, 70, 59, 51, 45, 39, 34, 25, 21, 9, 5],
    46. "text": "18-64 years",
    47. "description": "depicted in red."
    48. },
    49. {
    50. "values": [34, 30, 16, 15, 14, 12, 10, 9, 8, 7, 5, 4, 3],
    51. "text": "65 and over",
    52. "description": "depicted in green."
    53. }
    54. ]
    55. };
    56.  
    57. zingchart.render({
    58. id: 'myChart',
    59. data: chartConfig,
    60. height: 400,
    61. width: "100%"
    62. });