• 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": "area",
    18. "title": {
    19. "text": "Legend Items"
    20. },
    21. "subtitle": {
    22. "text": "legend-item object in plot/series",
    23. "font-weight": "normal"
    24. },
    25. "legend": {
    26. "layout": "5x1",
    27. "x": "82%",
    28. "y": "25%",
    29. },
    30. "plot": {
    31. "aspect": "spline",
    32. "stacked": true,
    33. "marker": {
    34. "visible": false
    35. },
    36. "legend-item": {
    37. "font-family": "Georgia"
    38. }
    39. },
    40. "plotarea": {
    41. "margin-right": "25%",
    42. },
    43. "scale-y": {
    44. "values": "0:1000:200",
    45. "guide": {
    46. "line-style": "dotted"
    47. }
    48. },
    49. "series": [{
    50. "values": [138.6, 196.3, 153.6, 127.4, 114.1, 181.4, 131.5, 170.9],
    51. "text": "Test 1",
    52. "legend-item": {
    53. "font-color": "#29A2CC",
    54. "background-color": "#eaf7fb"
    55. }
    56. },
    57. {
    58. "values": [84.8, 65.8, 122.4, 96.6, 279.1, 56.4, 275.9, 237.8],
    59. "text": "Test 2",
    60. "legend-item": {
    61. "font-color": "#D31E1E",
    62. "background-color": "#fce9e9"
    63. }
    64. },
    65. {
    66. "values": [108.7, 132.9, 61.6, 192.1, 134.5, 349.4, 183.9, 224.4],
    67. "text": "Test 3",
    68. "legend-item": {
    69. "font-color": "#7CA82B",
    70. "background-color": "#f5faeb"
    71. }
    72. },
    73. {
    74. "values": [213.2, 65.6, 139.5, 194.6, 184.4, 79.2, 73.1, 33.7],
    75. "text": "Test 4",
    76. "legend-item": {
    77. "font-color": "#EF8535",
    78. "background-color": "#fdf1e7"
    79. }
    80. },
    81. {
    82. "values": [236.6, 260.8, 155.2, 58.7, 119.1, 192.4, 164.8, 51.4],
    83. "text": "Test 5",
    84. "legend-item": {
    85. "font-color": "#A14BC9",
    86. "background-color": "#f5ebf9"
    87. }
    88. }
    89. ]
    90. };
    91.  
    92. zingchart.render({
    93. id: 'myChart',
    94. data: myConfig,
    95. height: 400,
    96. width: "100%"
    97. });
    98. </script>
    99. </body>
    100.  
    101. </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": "area",
    3. "title": {
    4. "text": "Legend Items"
    5. },
    6. "subtitle": {
    7. "text": "legend-item object in plot/series",
    8. "font-weight": "normal"
    9. },
    10. "legend": {
    11. "layout": "5x1",
    12. "x": "82%",
    13. "y": "25%",
    14. },
    15. "plot": {
    16. "aspect": "spline",
    17. "stacked": true,
    18. "marker": {
    19. "visible": false
    20. },
    21. "legend-item": {
    22. "font-family": "Georgia"
    23. }
    24. },
    25. "plotarea": {
    26. "margin-right": "25%",
    27. },
    28. "scale-y": {
    29. "values": "0:1000:200",
    30. "guide": {
    31. "line-style": "dotted"
    32. }
    33. },
    34. "series": [{
    35. "values": [138.6, 196.3, 153.6, 127.4, 114.1, 181.4, 131.5, 170.9],
    36. "text": "Test 1",
    37. "legend-item": {
    38. "font-color": "#29A2CC",
    39. "background-color": "#eaf7fb"
    40. }
    41. },
    42. {
    43. "values": [84.8, 65.8, 122.4, 96.6, 279.1, 56.4, 275.9, 237.8],
    44. "text": "Test 2",
    45. "legend-item": {
    46. "font-color": "#D31E1E",
    47. "background-color": "#fce9e9"
    48. }
    49. },
    50. {
    51. "values": [108.7, 132.9, 61.6, 192.1, 134.5, 349.4, 183.9, 224.4],
    52. "text": "Test 3",
    53. "legend-item": {
    54. "font-color": "#7CA82B",
    55. "background-color": "#f5faeb"
    56. }
    57. },
    58. {
    59. "values": [213.2, 65.6, 139.5, 194.6, 184.4, 79.2, 73.1, 33.7],
    60. "text": "Test 4",
    61. "legend-item": {
    62. "font-color": "#EF8535",
    63. "background-color": "#fdf1e7"
    64. }
    65. },
    66. {
    67. "values": [236.6, 260.8, 155.2, 58.7, 119.1, 192.4, 164.8, 51.4],
    68. "text": "Test 5",
    69. "legend-item": {
    70. "font-color": "#A14BC9",
    71. "background-color": "#f5ebf9"
    72. }
    73. }
    74. ]
    75. };
    76.  
    77. zingchart.render({
    78. id: 'myChart',
    79. data: myConfig,
    80. height: 400,
    81. width: "100%"
    82. });