• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script nonce="undefined" src='//code.jquery.com/jquery-2.1.4.min.js'></script>
    8. <script nonce="undefined" src='//code.jquery.com/ui/1.11.4/jquery-ui.min.js'></script>
    9. <link rel='stylesheet' href='//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css'>
    10.  
    11. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    12. <style>
    13. .container {
    14. width: 400px;
    15. height: 200px;
    16. min-width: 400px;
    17. border: 1px dashed #777;
    18. }
    19.  
    20. #myChart {
    21. width: 100%;
    22. height: 100%;
    23. }
    24. </style>
    25. </head>
    26.  
    27. <body>
    28. <div class='container'>
    29. <div id='myChart'></div>
    30. </div>
    31. <script>
    32. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    33. let chartConfig = {
    34. graphset: [{
    35. type: 'area',
    36. title: {
    37. text: 'Responsive Charting',
    38. adjustLayout: true,
    39. fontFamily: 'Georgia',
    40. fontSize: 20,
    41. mediaRules: [{
    42. maxWidth: 600,
    43. fontSize: 12
    44. },
    45. {
    46. maxWidth: 400,
    47. fontWeight: 'normal'
    48. }
    49. ]
    50. },
    51. legend: {
    52. align: 'right',
    53. verticalAlign: 'middle',
    54. layout: '4x2',
    55. borderWidth: 1,
    56. header: {
    57. text: 'Legend',
    58. textAlign: 'center',
    59. fontSize: 12
    60. },
    61. marker: {
    62. type: 'circle',
    63. borderWidth: 0,
    64. showLine: true,
    65. size: 3
    66. },
    67. mediaRules: [{
    68. maxWidth: 600,
    69. layout: '8x1',
    70. header: {
    71. visible: false
    72. },
    73. item: {
    74. fontSize: 10
    75. },
    76. marker: {
    77. size: 2,
    78. lineWidth: 1
    79. }
    80. },
    81. {
    82. maxWidth: 400,
    83. align: 'center',
    84. verticalAlign: 'bottom',
    85. layout: '2x4',
    86. item: {
    87. maxChars: 3,
    88. margin: 0
    89. },
    90. tooltip: {
    91. text: '%t',
    92. borderRadius: '3px'
    93. }
    94. }
    95. ]
    96. },
    97. plotarea: {
    98. adjustLayout: true
    99. },
    100. scaleX: {
    101. labels: ['Sun', 'Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat'],
    102. mediaRules: [{
    103. maxWidth: 600,
    104. item: {
    105. fontSize: 10
    106. }
    107. },
    108. {
    109. maxWidth: 400,
    110. labels: ['S', 'M', 'T', 'W', 'H', 'F', 'S'],
    111. item: {
    112. fontSize: 10
    113. }
    114. }
    115. ]
    116. },
    117. scaleY: {
    118. guide: {
    119. lineStyle: 'dotted'
    120. },
    121. mediaRules: [{
    122. maxWidth: 600,
    123. item: {
    124. fontSize: 10
    125. }
    126. },
    127. {
    128. maxWidth: 400,
    129. item: {
    130. fontSize: 10
    131. }
    132. }
    133. ]
    134. },
    135. plot: {
    136. animation: {
    137. effect: 10,
    138. method: 0,
    139. sequence: 1,
    140. speed: 1
    141. },
    142. tooltip: {
    143. text: '%t: %v',
    144. borderRadius: '3px'
    145. },
    146. aspect: 'spline',
    147. marker: {
    148. size: 3,
    149. borderWidth: 0
    150. },
    151. mediaRules: [{
    152. maxWidth: 600,
    153. lineWidth: 1,
    154. marker: {
    155. size: 2
    156. },
    157. tooltip: {
    158. text: '%t:<br>%v'
    159. }
    160. },
    161. {
    162. maxWidth: 400,
    163. marker: {
    164. visible: false
    165. },
    166. tooltip: {
    167. text: '%v'
    168. }
    169. }
    170. ]
    171. },
    172. series: [{
    173. values: [31, 66, 35, 33, 59, 61, 55],
    174. text: 'Alpha',
    175. lineColor: '#1B4F72',
    176. backgroundColor: '#1B4F72',
    177. marker: {
    178. backgroundColor: '#1B4F72'
    179. }
    180. },
    181. {
    182. values: [40, 49, 15, 21, 70, 51, 69],
    183. text: 'Beta',
    184. lineColor: '#21618C',
    185. backgroundColor: '#21618C',
    186. marker: {
    187. backgroundColor: '#21618C'
    188. }
    189. },
    190. {
    191. values: [33, 35, 17, 61, 66, 32, 35],
    192. text: 'Gamma',
    193. lineColor: '#2874A6',
    194. backgroundColor: '#2874A6',
    195. marker: {
    196. backgroundColor: '#2874A6'
    197. }
    198. },
    199. {
    200. values: [21, 25, 59, 70, 81, 23, 61],
    201. text: 'Delta',
    202. lineColor: '#2E86C1',
    203. backgroundColor: '#2E86C1',
    204. marker: {
    205. backgroundColor: '#2E86C1'
    206. }
    207. },
    208. {
    209. values: [61, 81, 91, 30, 14, 26, 19],
    210. text: 'Epsilon',
    211. lineColor: '#3498DB',
    212. backgroundColor: '#3498DB',
    213. marker: {
    214. backgroundColor: '#3498DB'
    215. }
    216. },
    217. {
    218. values: [50, 95, 88, 77, 66, 55, 79],
    219. text: 'Zeta',
    220. lineColor: '#5DADE2',
    221. backgroundColor: '#5DADE2',
    222. marker: {
    223. backgroundColor: '#5DADE2'
    224. }
    225. },
    226. {
    227. values: [11, 19, 81, 40, 40, 81, 51],
    228. text: 'Eta',
    229. lineColor: '#85C1E9',
    230. backgroundColor: '#85C1E9',
    231. marker: {
    232. backgroundColor: '#85C1E9'
    233. }
    234. },
    235. {
    236. values: [81, 30, 91, 85, 51, 88, 71],
    237. text: 'Theta',
    238. lineColor: '#AED6F1',
    239. backgroundColor: '#AED6F1',
    240. marker: {
    241. backgroundColor: '#AED6F1'
    242. }
    243. }
    244. ]
    245. }]
    246. };
    247.  
    248. // adjust the refresh rate of the chart
    249. zingchart.DEV.RESIZESPEED = 50;
    250. zingchart.DEV.DEBOUNCESPEED = 50;
    251.  
    252. zingchart.render({
    253. id: 'myChart',
    254. data: chartConfig,
    255. height: '100%',
    256. width: '100%'
    257. });
    258.  
    259. // initiate jquery resizable container for demo purposes
    260. $('.container').resizable();
    261. </script>
    262. </body>
    263.  
    264. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script src='//code.jquery.com/jquery-2.1.4.min.js'></script>
    8. <script src='//code.jquery.com/ui/1.11.4/jquery-ui.min.js'></script>
    9. <link rel='stylesheet' href='//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css'>
    10.  
    11. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    12. </head>
    13.  
    14. <body>
    15. <div class='container'>
    16. <div id='myChart'></div>
    17. </div>
    18. </body>
    19.  
    20. </html>
    1. .container {
    2. width: 400px;
    3. height: 200px;
    4. min-width: 400px;
    5. border: 1px dashed #777;
    6. }
    7.  
    8. #myChart {
    9. width: 100%;
    10. height: 100%;
    11. }
    1. let chartConfig = {
    2. graphset: [{
    3. type: 'area',
    4. title: {
    5. text: 'Responsive Charting',
    6. adjustLayout: true,
    7. fontFamily: 'Georgia',
    8. fontSize: 20,
    9. mediaRules: [{
    10. maxWidth: 600,
    11. fontSize: 12
    12. },
    13. {
    14. maxWidth: 400,
    15. fontWeight: 'normal'
    16. }
    17. ]
    18. },
    19. legend: {
    20. align: 'right',
    21. verticalAlign: 'middle',
    22. layout: '4x2',
    23. borderWidth: 1,
    24. header: {
    25. text: 'Legend',
    26. textAlign: 'center',
    27. fontSize: 12
    28. },
    29. marker: {
    30. type: 'circle',
    31. borderWidth: 0,
    32. showLine: true,
    33. size: 3
    34. },
    35. mediaRules: [{
    36. maxWidth: 600,
    37. layout: '8x1',
    38. header: {
    39. visible: false
    40. },
    41. item: {
    42. fontSize: 10
    43. },
    44. marker: {
    45. size: 2,
    46. lineWidth: 1
    47. }
    48. },
    49. {
    50. maxWidth: 400,
    51. align: 'center',
    52. verticalAlign: 'bottom',
    53. layout: '2x4',
    54. item: {
    55. maxChars: 3,
    56. margin: 0
    57. },
    58. tooltip: {
    59. text: '%t',
    60. borderRadius: '3px'
    61. }
    62. }
    63. ]
    64. },
    65. plotarea: {
    66. adjustLayout: true
    67. },
    68. scaleX: {
    69. labels: ['Sun', 'Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat'],
    70. mediaRules: [{
    71. maxWidth: 600,
    72. item: {
    73. fontSize: 10
    74. }
    75. },
    76. {
    77. maxWidth: 400,
    78. labels: ['S', 'M', 'T', 'W', 'H', 'F', 'S'],
    79. item: {
    80. fontSize: 10
    81. }
    82. }
    83. ]
    84. },
    85. scaleY: {
    86. guide: {
    87. lineStyle: 'dotted'
    88. },
    89. mediaRules: [{
    90. maxWidth: 600,
    91. item: {
    92. fontSize: 10
    93. }
    94. },
    95. {
    96. maxWidth: 400,
    97. item: {
    98. fontSize: 10
    99. }
    100. }
    101. ]
    102. },
    103. plot: {
    104. animation: {
    105. effect: 10,
    106. method: 0,
    107. sequence: 1,
    108. speed: 1
    109. },
    110. tooltip: {
    111. text: '%t: %v',
    112. borderRadius: '3px'
    113. },
    114. aspect: 'spline',
    115. marker: {
    116. size: 3,
    117. borderWidth: 0
    118. },
    119. mediaRules: [{
    120. maxWidth: 600,
    121. lineWidth: 1,
    122. marker: {
    123. size: 2
    124. },
    125. tooltip: {
    126. text: '%t:<br>%v'
    127. }
    128. },
    129. {
    130. maxWidth: 400,
    131. marker: {
    132. visible: false
    133. },
    134. tooltip: {
    135. text: '%v'
    136. }
    137. }
    138. ]
    139. },
    140. series: [{
    141. values: [31, 66, 35, 33, 59, 61, 55],
    142. text: 'Alpha',
    143. lineColor: '#1B4F72',
    144. backgroundColor: '#1B4F72',
    145. marker: {
    146. backgroundColor: '#1B4F72'
    147. }
    148. },
    149. {
    150. values: [40, 49, 15, 21, 70, 51, 69],
    151. text: 'Beta',
    152. lineColor: '#21618C',
    153. backgroundColor: '#21618C',
    154. marker: {
    155. backgroundColor: '#21618C'
    156. }
    157. },
    158. {
    159. values: [33, 35, 17, 61, 66, 32, 35],
    160. text: 'Gamma',
    161. lineColor: '#2874A6',
    162. backgroundColor: '#2874A6',
    163. marker: {
    164. backgroundColor: '#2874A6'
    165. }
    166. },
    167. {
    168. values: [21, 25, 59, 70, 81, 23, 61],
    169. text: 'Delta',
    170. lineColor: '#2E86C1',
    171. backgroundColor: '#2E86C1',
    172. marker: {
    173. backgroundColor: '#2E86C1'
    174. }
    175. },
    176. {
    177. values: [61, 81, 91, 30, 14, 26, 19],
    178. text: 'Epsilon',
    179. lineColor: '#3498DB',
    180. backgroundColor: '#3498DB',
    181. marker: {
    182. backgroundColor: '#3498DB'
    183. }
    184. },
    185. {
    186. values: [50, 95, 88, 77, 66, 55, 79],
    187. text: 'Zeta',
    188. lineColor: '#5DADE2',
    189. backgroundColor: '#5DADE2',
    190. marker: {
    191. backgroundColor: '#5DADE2'
    192. }
    193. },
    194. {
    195. values: [11, 19, 81, 40, 40, 81, 51],
    196. text: 'Eta',
    197. lineColor: '#85C1E9',
    198. backgroundColor: '#85C1E9',
    199. marker: {
    200. backgroundColor: '#85C1E9'
    201. }
    202. },
    203. {
    204. values: [81, 30, 91, 85, 51, 88, 71],
    205. text: 'Theta',
    206. lineColor: '#AED6F1',
    207. backgroundColor: '#AED6F1',
    208. marker: {
    209. backgroundColor: '#AED6F1'
    210. }
    211. }
    212. ]
    213. }]
    214. };
    215.  
    216. // adjust the refresh rate of the chart
    217. zingchart.DEV.RESIZESPEED = 50;
    218. zingchart.DEV.DEBOUNCESPEED = 50;
    219.  
    220. zingchart.render({
    221. id: 'myChart',
    222. data: chartConfig,
    223. height: '100%',
    224. width: '100%'
    225. });
    226.  
    227. // initiate jquery resizable container for demo purposes
    228. $('.container').resizable();