morris-data.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. // Morris.js Charts sample data for SB Admin template
  2. $(function() {
  3. // Area Chart
  4. Morris.Area({
  5. element: 'morris-area-chart',
  6. data: [{
  7. period: '2010 Q1',
  8. iphone: 2666,
  9. ipad: null,
  10. itouch: 2647
  11. }, {
  12. period: '2010 Q2',
  13. iphone: 2778,
  14. ipad: 2294,
  15. itouch: 2441
  16. }, {
  17. period: '2010 Q3',
  18. iphone: 4912,
  19. ipad: 1969,
  20. itouch: 2501
  21. }, {
  22. period: '2010 Q4',
  23. iphone: 3767,
  24. ipad: 3597,
  25. itouch: 5689
  26. }, {
  27. period: '2011 Q1',
  28. iphone: 6810,
  29. ipad: 1914,
  30. itouch: 2293
  31. }, {
  32. period: '2011 Q2',
  33. iphone: 5670,
  34. ipad: 4293,
  35. itouch: 1881
  36. }, {
  37. period: '2011 Q3',
  38. iphone: 4820,
  39. ipad: 3795,
  40. itouch: 1588
  41. }, {
  42. period: '2011 Q4',
  43. iphone: 15073,
  44. ipad: 5967,
  45. itouch: 5175
  46. }, {
  47. period: '2012 Q1',
  48. iphone: 10687,
  49. ipad: 4460,
  50. itouch: 2028
  51. }, {
  52. period: '2012 Q2',
  53. iphone: 8432,
  54. ipad: 5713,
  55. itouch: 1791
  56. }],
  57. xkey: 'period',
  58. ykeys: ['iphone', 'ipad', 'itouch'],
  59. labels: ['iPhone', 'iPad', 'iPod Touch'],
  60. pointSize: 2,
  61. hideHover: 'auto',
  62. resize: true
  63. });
  64. // Donut Chart
  65. Morris.Donut({
  66. element: 'morris-donut-chart',
  67. data: [{
  68. label: "Download Sales",
  69. value: 12
  70. }, {
  71. label: "In-Store Sales",
  72. value: 30
  73. }, {
  74. label: "Mail-Order Sales",
  75. value: 20
  76. }],
  77. resize: true
  78. });
  79. // Line Chart
  80. Morris.Line({
  81. // ID of the element in which to draw the chart.
  82. element: 'morris-line-chart',
  83. // Chart data records -- each entry in this array corresponds to a point on
  84. // the chart.
  85. data: [{
  86. d: '2012-10-01',
  87. visits: 802
  88. }, {
  89. d: '2012-10-02',
  90. visits: 783
  91. }, {
  92. d: '2012-10-03',
  93. visits: 820
  94. }, {
  95. d: '2012-10-04',
  96. visits: 839
  97. }, {
  98. d: '2012-10-05',
  99. visits: 792
  100. }, {
  101. d: '2012-10-06',
  102. visits: 859
  103. }, {
  104. d: '2012-10-07',
  105. visits: 790
  106. }, {
  107. d: '2012-10-08',
  108. visits: 1680
  109. }, {
  110. d: '2012-10-09',
  111. visits: 1592
  112. }, {
  113. d: '2012-10-10',
  114. visits: 1420
  115. }, {
  116. d: '2012-10-11',
  117. visits: 882
  118. }, {
  119. d: '2012-10-12',
  120. visits: 889
  121. }, {
  122. d: '2012-10-13',
  123. visits: 819
  124. }, {
  125. d: '2012-10-14',
  126. visits: 849
  127. }, {
  128. d: '2012-10-15',
  129. visits: 870
  130. }, {
  131. d: '2012-10-16',
  132. visits: 1063
  133. }, {
  134. d: '2012-10-17',
  135. visits: 1192
  136. }, {
  137. d: '2012-10-18',
  138. visits: 1224
  139. }, {
  140. d: '2012-10-19',
  141. visits: 1329
  142. }, {
  143. d: '2012-10-20',
  144. visits: 1329
  145. }, {
  146. d: '2012-10-21',
  147. visits: 1239
  148. }, {
  149. d: '2012-10-22',
  150. visits: 1190
  151. }, {
  152. d: '2012-10-23',
  153. visits: 1312
  154. }, {
  155. d: '2012-10-24',
  156. visits: 1293
  157. }, {
  158. d: '2012-10-25',
  159. visits: 1283
  160. }, {
  161. d: '2012-10-26',
  162. visits: 1248
  163. }, {
  164. d: '2012-10-27',
  165. visits: 1323
  166. }, {
  167. d: '2012-10-28',
  168. visits: 1390
  169. }, {
  170. d: '2012-10-29',
  171. visits: 1420
  172. }, {
  173. d: '2012-10-30',
  174. visits: 1529
  175. }, {
  176. d: '2012-10-31',
  177. visits: 1892
  178. }, ],
  179. // The name of the data record attribute that contains x-visitss.
  180. xkey: 'd',
  181. // A list of names of data record attributes that contain y-visitss.
  182. ykeys: ['visits'],
  183. // Labels for the ykeys -- will be displayed when you hover over the
  184. // chart.
  185. labels: ['Visits'],
  186. // Disables line smoothing
  187. smooth: false,
  188. resize: true
  189. });
  190. // Bar Chart
  191. Morris.Bar({
  192. element: 'morris-bar-chart',
  193. data: [{
  194. device: 'iPhone',
  195. geekbench: 136
  196. }, {
  197. device: 'iPhone 3G',
  198. geekbench: 137
  199. }, {
  200. device: 'iPhone 3GS',
  201. geekbench: 275
  202. }, {
  203. device: 'iPhone 4',
  204. geekbench: 380
  205. }, {
  206. device: 'iPhone 4S',
  207. geekbench: 655
  208. }, {
  209. device: 'iPhone 5',
  210. geekbench: 1571
  211. }],
  212. xkey: 'device',
  213. ykeys: ['geekbench'],
  214. labels: ['Geekbench'],
  215. barRatio: 0.4,
  216. xLabelAngle: 35,
  217. hideHover: 'auto',
  218. resize: true
  219. });
  220. });