morris.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. (function (global, factory) {
  2. if (typeof define === "function" && define.amd) {
  3. define("/charts/morris", ["jquery", "Site"], factory);
  4. } else if (typeof exports !== "undefined") {
  5. factory(require("jquery"), require("Site"));
  6. } else {
  7. var mod = {
  8. exports: {}
  9. };
  10. factory(global.jQuery, global.Site);
  11. global.chartsMorris = mod.exports;
  12. }
  13. })(this, function (_jquery, _Site) {
  14. "use strict";
  15. _jquery = babelHelpers.interopRequireDefault(_jquery);
  16. (0, _jquery.default)(document).ready(function ($$$1) {
  17. (0, _Site.run)();
  18. }); // Example Morris Line
  19. // -------------------
  20. (function () {
  21. Morris.Line({
  22. element: 'exampleMorrisLine',
  23. data: [{
  24. "y": "2015 Q3",
  25. "a": 40,
  26. "b": 100
  27. }, {
  28. "y": "2015 Q2",
  29. "a": 75,
  30. "b": 165
  31. }, {
  32. "y": "2015 Q1",
  33. "a": 150,
  34. "b": 240
  35. }, {
  36. "y": "2014 Q4",
  37. "a": 100,
  38. "b": 270
  39. }, {
  40. "y": "2013 Q4",
  41. "a": 260,
  42. "b": 300
  43. }, {
  44. "y": "2012 Q4",
  45. "a": 20,
  46. "b": 225
  47. }, {
  48. "y": "2011 Q4",
  49. "a": 295,
  50. "b": 110
  51. }],
  52. xkey: 'y',
  53. ykeys: ['a', 'b'],
  54. labels: ['Series A', 'Series B'],
  55. resize: true,
  56. pointSize: 3,
  57. smooth: true,
  58. gridTextColor: '#474e54',
  59. gridLineColor: '#eef0f2',
  60. goalLineColors: '#e3e6ea',
  61. gridTextFamily: Config.get('fontFamily'),
  62. gridTextWeight: '300',
  63. numLines: 7,
  64. gridtextSize: 14,
  65. lineWidth: 1,
  66. lineColors: [Config.colors("green", 600), Config.colors("primary", 600)]
  67. });
  68. })(); // Example Morris Area
  69. // -------------------
  70. (function () {
  71. Morris.Area({
  72. element: 'exampleMorrisArea',
  73. data: [{
  74. y: '6',
  75. a: 270,
  76. b: 160
  77. }, {
  78. y: '7',
  79. a: 210,
  80. b: 110
  81. }, {
  82. y: '8',
  83. a: 240,
  84. b: 130
  85. }, {
  86. y: '9',
  87. a: 280,
  88. b: 250
  89. }, {
  90. y: '10',
  91. a: 210,
  92. b: 140
  93. }, {
  94. y: '11',
  95. a: 150,
  96. b: 90
  97. }, {
  98. y: '12',
  99. a: 290,
  100. b: 180
  101. }, {
  102. y: '13',
  103. a: 280,
  104. b: 240
  105. }],
  106. xkey: 'y',
  107. ykeys: ['a', 'b'],
  108. labels: ['Series A', 'Series B'],
  109. behaveLikeLine: true,
  110. ymax: 300,
  111. resize: true,
  112. pointSize: 3,
  113. smooth: true,
  114. gridTextColor: '#474e54',
  115. gridLineColor: '#eef0f2',
  116. goalLineColors: '#e3e6ea',
  117. gridTextFamily: Config.get('fontFamily'),
  118. gridTextWeight: '300',
  119. numLines: 7,
  120. gridtextSize: 14,
  121. lineWidth: 1,
  122. fillOpacity: 0.1,
  123. lineColors: [Config.colors("primary", 600), Config.colors("green", 600)]
  124. });
  125. })(); // Example Morris Bar
  126. // ------------------
  127. (function () {
  128. Morris.Bar({
  129. element: 'exampleMorrisBar',
  130. data: [{
  131. y: '2013-6',
  132. a: 350,
  133. b: 410
  134. }, {
  135. y: '2013-7',
  136. a: 110,
  137. b: 300
  138. }, {
  139. y: '2013-8',
  140. a: 460,
  141. b: 130
  142. }, {
  143. y: '2013-9',
  144. a: 250,
  145. b: 310 // { y: '2013-10', a: 50, b: 40 },
  146. // { y: '2013-11', a: 75, b: 65 },
  147. // { y: '2013-12', a: 100, b: 90 }
  148. }],
  149. xkey: 'y',
  150. ykeys: ['a', 'b'],
  151. labels: ['Series A', 'Series B'],
  152. barGap: 6,
  153. barSizeRatio: 0.35,
  154. smooth: true,
  155. gridTextColor: '#474e54',
  156. gridLineColor: '#eef0f2',
  157. goalLineColors: '#e3e6ea',
  158. gridTextFamily: Config.get('fontFamily'),
  159. gridTextWeight: '300',
  160. numLines: 6,
  161. gridtextSize: 14,
  162. resize: true,
  163. barColors: [Config.colors("red", 500), Config.colors("blue-grey", 300)]
  164. });
  165. })(); // Example Morris Donut
  166. // --------------------
  167. (function () {
  168. Morris.Donut({
  169. element: 'exampleMorrisDonut',
  170. data: [{
  171. label: "Download Sales",
  172. value: 35
  173. }, {
  174. label: "In-Store Sales",
  175. value: 48
  176. }, {
  177. label: "Mail-Order Sales",
  178. value: 22
  179. }],
  180. // barSizeRatio: 0.35,
  181. resize: true,
  182. colors: [Config.colors("red", 500), Config.colors("primary", 500), Config.colors("blue-grey", 300)]
  183. });
  184. })();
  185. });