• 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: 300px;
    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. var myConfig = {
    34. type: 'line',
    35. backgroundColor: '#eaf5d6',
    36. mediaRules: [{
    37. maxWidth: 500,
    38. backgroundColor: '#cbe698'
    39. },
    40. {
    41. maxWidth: 300,
    42. backgroundColor: '#acd75b'
    43. }
    44. ],
    45. title: {
    46. text: 'Responsive Line Chart',
    47. adjustLayout: true, //automatically adjusts the layout of the object, in relation to other objects
    48. fontFamily: 'Georgia',
    49. backgroundColor: '#d4eef7',
    50. fontSize: 20,
    51. mediaRules: [{
    52. maxWidth: 500,
    53. backgroundColor: '#93d5eb',
    54. fontSize: 12
    55. },
    56. {
    57. maxWidth: 300,
    58. visible: false //removes the title object at this breakpoint
    59. }
    60. ]
    61. },
    62. legend: {
    63. align: 'right',
    64. verticalAlign: 'middle',
    65. //the above attributes also automatically adjust the layout of the object, in relation to other objects
    66. layout: '4x2',
    67. borderWidth: 1,
    68. backgroundColor: '#d4eef7',
    69. header: {
    70. text: 'Legend',
    71. textAlign: 'center',
    72. fontSize: 12
    73. },
    74. marker: {
    75. type: 'circle',
    76. showLine: true,
    77. size: 4
    78. },
    79. mediaRules: [{
    80. maxWidth: 500,
    81. layout: '8x1',
    82. backgroundColor: '#93d5eb',
    83. header: {
    84. visible: false
    85. },
    86. item: {
    87. fontSize: 10,
    88. margin: 1
    89. },
    90. marker: {
    91. size: 3,
    92. }
    93. },
    94. {
    95. maxWidth: 300,
    96. visible: false //removes the legend object at this breakpoint
    97. }
    98. ]
    99. },
    100. plotarea: {
    101. adjustLayout: true, //automatically adjusts the layout of the object, in relation to other objects
    102. backgroundColor: '#d4eef7',
    103. mediaRules: [{
    104. maxWidth: 500,
    105. backgroundColor: '#93d5eb'
    106. },
    107. {
    108. maxWidth: 300,
    109. backgroundColor: '#53bcdf'
    110. }
    111. ]
    112. },
    113. scaleX: {
    114. labels: ['Sun', 'Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat'],
    115. mediaRules: [{
    116. maxWidth: 500,
    117. item: {
    118. fontSize: 10
    119. }
    120. },
    121. {
    122. maxWidth: 300,
    123. labels: ['S', 'M', 'T', 'W', 'H', 'F', 'S'],
    124. item: {
    125. fontSize: 10
    126. }
    127. }
    128. ]
    129. },
    130. scaleY: {
    131. guide: {
    132. lineStyle: 'dotted'
    133. },
    134. mediaRules: [{
    135. maxWidth: 500,
    136. item: {
    137. fontSize: 10
    138. }
    139. },
    140. {
    141. maxWidth: 300,
    142. item: {
    143. fontSize: 10
    144. }
    145. }
    146. ]
    147. },
    148. plot: {
    149. tooltip: {
    150. text: '%t: %v',
    151. borderRadius: '3px'
    152. },
    153. mediaRules: [{
    154. maxWidth: 500,
    155. marker: {
    156. size: 3
    157. },
    158. tooltip: {
    159. text: '%t:<br>%v',
    160. fontSize: 10
    161. }
    162. },
    163. {
    164. maxWidth: 300,
    165. marker: {
    166. visible: false
    167. },
    168. tooltip: {
    169. text: '%v'
    170. }
    171. }
    172. ]
    173. },
    174. series: [{
    175. values: [31, 66, 35, 33, 59, 61, 55]
    176. },
    177. {
    178. values: [40, 49, 15, 21, 70, 51, 69]
    179. },
    180. {
    181. values: [33, 35, 17, 61, 66, 32, 35]
    182. },
    183. {
    184. values: [21, 25, 59, 70, 81, 23, 61]
    185. },
    186. {
    187. values: [61, 81, 91, 30, 14, 26, 19]
    188. },
    189. {
    190. values: [50, 95, 88, 77, 66, 55, 79]
    191. },
    192. {
    193. values: [11, 19, 81, 40, 40, 81, 51]
    194. },
    195. {
    196. values: [81, 30, 91, 85, 51, 88, 71]
    197. }
    198. ]
    199. };
    200.  
    201. // adjust the refresh rate of the chart
    202. zingchart.DEV.RESIZESPEED = 50;
    203. zingchart.DEV.DEBOUNCESPEED = 50;
    204.  
    205. zingchart.render({
    206. id: 'myChart',
    207. data: myConfig,
    208. height: '100%',
    209. width: '100%'
    210. });
    211.  
    212. // initiate jquery resizable container for demo purposes
    213. $('.container').resizable();
    214. </script>
    215. </body>
    216.  
    217. </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: 300px;
    4. min-width: 400px;
    5. border: 1px dashed #777;
    6. }
    7.  
    8. #myChart {
    9. width: 100%;
    10. height: 100%;
    11. }
    1. var myConfig = {
    2. type: 'line',
    3. backgroundColor: '#eaf5d6',
    4. mediaRules: [{
    5. maxWidth: 500,
    6. backgroundColor: '#cbe698'
    7. },
    8. {
    9. maxWidth: 300,
    10. backgroundColor: '#acd75b'
    11. }
    12. ],
    13. title: {
    14. text: 'Responsive Line Chart',
    15. adjustLayout: true, //automatically adjusts the layout of the object, in relation to other objects
    16. fontFamily: 'Georgia',
    17. backgroundColor: '#d4eef7',
    18. fontSize: 20,
    19. mediaRules: [{
    20. maxWidth: 500,
    21. backgroundColor: '#93d5eb',
    22. fontSize: 12
    23. },
    24. {
    25. maxWidth: 300,
    26. visible: false //removes the title object at this breakpoint
    27. }
    28. ]
    29. },
    30. legend: {
    31. align: 'right',
    32. verticalAlign: 'middle',
    33. //the above attributes also automatically adjust the layout of the object, in relation to other objects
    34. layout: '4x2',
    35. borderWidth: 1,
    36. backgroundColor: '#d4eef7',
    37. header: {
    38. text: 'Legend',
    39. textAlign: 'center',
    40. fontSize: 12
    41. },
    42. marker: {
    43. type: 'circle',
    44. showLine: true,
    45. size: 4
    46. },
    47. mediaRules: [{
    48. maxWidth: 500,
    49. layout: '8x1',
    50. backgroundColor: '#93d5eb',
    51. header: {
    52. visible: false
    53. },
    54. item: {
    55. fontSize: 10,
    56. margin: 1
    57. },
    58. marker: {
    59. size: 3,
    60. }
    61. },
    62. {
    63. maxWidth: 300,
    64. visible: false //removes the legend object at this breakpoint
    65. }
    66. ]
    67. },
    68. plotarea: {
    69. adjustLayout: true, //automatically adjusts the layout of the object, in relation to other objects
    70. backgroundColor: '#d4eef7',
    71. mediaRules: [{
    72. maxWidth: 500,
    73. backgroundColor: '#93d5eb'
    74. },
    75. {
    76. maxWidth: 300,
    77. backgroundColor: '#53bcdf'
    78. }
    79. ]
    80. },
    81. scaleX: {
    82. labels: ['Sun', 'Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat'],
    83. mediaRules: [{
    84. maxWidth: 500,
    85. item: {
    86. fontSize: 10
    87. }
    88. },
    89. {
    90. maxWidth: 300,
    91. labels: ['S', 'M', 'T', 'W', 'H', 'F', 'S'],
    92. item: {
    93. fontSize: 10
    94. }
    95. }
    96. ]
    97. },
    98. scaleY: {
    99. guide: {
    100. lineStyle: 'dotted'
    101. },
    102. mediaRules: [{
    103. maxWidth: 500,
    104. item: {
    105. fontSize: 10
    106. }
    107. },
    108. {
    109. maxWidth: 300,
    110. item: {
    111. fontSize: 10
    112. }
    113. }
    114. ]
    115. },
    116. plot: {
    117. tooltip: {
    118. text: '%t: %v',
    119. borderRadius: '3px'
    120. },
    121. mediaRules: [{
    122. maxWidth: 500,
    123. marker: {
    124. size: 3
    125. },
    126. tooltip: {
    127. text: '%t:<br>%v',
    128. fontSize: 10
    129. }
    130. },
    131. {
    132. maxWidth: 300,
    133. marker: {
    134. visible: false
    135. },
    136. tooltip: {
    137. text: '%v'
    138. }
    139. }
    140. ]
    141. },
    142. series: [{
    143. values: [31, 66, 35, 33, 59, 61, 55]
    144. },
    145. {
    146. values: [40, 49, 15, 21, 70, 51, 69]
    147. },
    148. {
    149. values: [33, 35, 17, 61, 66, 32, 35]
    150. },
    151. {
    152. values: [21, 25, 59, 70, 81, 23, 61]
    153. },
    154. {
    155. values: [61, 81, 91, 30, 14, 26, 19]
    156. },
    157. {
    158. values: [50, 95, 88, 77, 66, 55, 79]
    159. },
    160. {
    161. values: [11, 19, 81, 40, 40, 81, 51]
    162. },
    163. {
    164. values: [81, 30, 91, 85, 51, 88, 71]
    165. }
    166. ]
    167. };
    168.  
    169. // adjust the refresh rate of the chart
    170. zingchart.DEV.RESIZESPEED = 50;
    171. zingchart.DEV.DEBOUNCESPEED = 50;
    172.  
    173. zingchart.render({
    174. id: 'myChart',
    175. data: myConfig,
    176. height: '100%',
    177. width: '100%'
    178. });
    179.  
    180. // initiate jquery resizable container for demo purposes
    181. $('.container').resizable();