• 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 Markers"
    20. },
    21. "subtitle": {
    22. "text": "legend-marker 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-marker": {
    37. "show-line": true,
    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-marker": {
    53. "type": "square",
    54. "background-color": "#eaf7fb",
    55. "border-color": "#29A2CC",
    56. "border-width": 2
    57. }
    58. },
    59. {
    60. "values": [84.8, 65.8, 122.4, 96.6, 279.1, 56.4, 275.9, 237.8],
    61. "text": "Test 2",
    62. "legend-marker": {
    63. "type": "circle",
    64. "background-color": "#fce9e9",
    65. "border-color": "#D31E1E",
    66. "border-width": 2
    67. }
    68. },
    69. {
    70. "values": [108.7, 132.9, 61.6, 192.1, 134.5, 349.4, 183.9, 224.4],
    71. "text": "Test 3",
    72. "legend-marker": {
    73. "type": "diamond",
    74. "background-color": "#f5faeb",
    75. "border-color": "#7CA82B",
    76. "border-width": 2
    77. }
    78. },
    79. {
    80. "values": [213.2, 65.6, 139.5, 194.6, 184.4, 79.2, 73.1, 33.7],
    81. "text": "Test 4",
    82. "legend-marker": {
    83. "type": "star5",
    84. "background-color": "#fdf1e7",
    85. "border-color": "#EF8535",
    86. "border-width": 2
    87. }
    88. },
    89. {
    90. "values": [236.6, 260.8, 155.2, 58.7, 119.1, 192.4, 164.8, 51.4],
    91. "text": "Test 5",
    92. "legend-marker": {
    93. "type": "rpoly5",
    94. "background-color": "#f5ebf9",
    95. "border-color": "#A14BC9",
    96. "border-width": 2
    97. }
    98. }
    99. ]
    100. };
    101.  
    102. zingchart.render({
    103. id: 'myChart',
    104. data: myConfig,
    105. height: 400,
    106. width: "100%"
    107. });
    108. </script>
    109. </body>
    110.  
    111. </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 Markers"
    5. },
    6. "subtitle": {
    7. "text": "legend-marker 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-marker": {
    22. "show-line": true,
    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-marker": {
    38. "type": "square",
    39. "background-color": "#eaf7fb",
    40. "border-color": "#29A2CC",
    41. "border-width": 2
    42. }
    43. },
    44. {
    45. "values": [84.8, 65.8, 122.4, 96.6, 279.1, 56.4, 275.9, 237.8],
    46. "text": "Test 2",
    47. "legend-marker": {
    48. "type": "circle",
    49. "background-color": "#fce9e9",
    50. "border-color": "#D31E1E",
    51. "border-width": 2
    52. }
    53. },
    54. {
    55. "values": [108.7, 132.9, 61.6, 192.1, 134.5, 349.4, 183.9, 224.4],
    56. "text": "Test 3",
    57. "legend-marker": {
    58. "type": "diamond",
    59. "background-color": "#f5faeb",
    60. "border-color": "#7CA82B",
    61. "border-width": 2
    62. }
    63. },
    64. {
    65. "values": [213.2, 65.6, 139.5, 194.6, 184.4, 79.2, 73.1, 33.7],
    66. "text": "Test 4",
    67. "legend-marker": {
    68. "type": "star5",
    69. "background-color": "#fdf1e7",
    70. "border-color": "#EF8535",
    71. "border-width": 2
    72. }
    73. },
    74. {
    75. "values": [236.6, 260.8, 155.2, 58.7, 119.1, 192.4, 164.8, 51.4],
    76. "text": "Test 5",
    77. "legend-marker": {
    78. "type": "rpoly5",
    79. "background-color": "#f5ebf9",
    80. "border-color": "#A14BC9",
    81. "border-width": 2
    82. }
    83. }
    84. ]
    85. };
    86.  
    87. zingchart.render({
    88. id: 'myChart',
    89. data: myConfig,
    90. height: 400,
    91. width: "100%"
    92. });