visual_specs.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. var examples = require('./examples');
  2. examples.def('line', function () {
  3. Morris.Line({
  4. element: 'chart',
  5. data: [
  6. { x: 0, y: 10, z: 30 }, { x: 1, y: 20, z: 20 },
  7. { x: 2, y: 30, z: 10 }, { x: 3, y: 30, z: 10 },
  8. { x: 4, y: 20, z: 20 }, { x: 5, y: 10, z: 30 }
  9. ],
  10. xkey: 'x',
  11. ykeys: ['y', 'z'],
  12. labels: ['y', 'z'],
  13. parseTime: false
  14. });
  15. window.snapshot();
  16. });
  17. examples.def('area', function () {
  18. Morris.Area({
  19. element: 'chart',
  20. data: [
  21. { x: 0, y: 1, z: 1 }, { x: 1, y: 2, z: 1 },
  22. { x: 2, y: 3, z: 1 }, { x: 3, y: 3, z: 1 },
  23. { x: 4, y: 2, z: 1 }, { x: 5, y: 1, z: 1 }
  24. ],
  25. xkey: 'x',
  26. ykeys: ['y', 'z'],
  27. labels: ['y', 'z'],
  28. parseTime: false
  29. });
  30. window.snapshot();
  31. });
  32. examples.def('bar', function () {
  33. Morris.Bar({
  34. element: 'chart',
  35. data: [
  36. { x: 0, y: 1, z: 3 }, { x: 1, y: 2, z: 2 },
  37. { x: 2, y: 3, z: 1 }, { x: 3, y: 3, z: 1 },
  38. { x: 4, y: 2, z: 2 }, { x: 5, y: 1, z: 3 }
  39. ],
  40. xkey: 'x',
  41. ykeys: ['y', 'z'],
  42. labels: ['y', 'z']
  43. });
  44. window.snapshot();
  45. });
  46. examples.def('stacked_bar', function () {
  47. Morris.Bar({
  48. element: 'chart',
  49. data: [
  50. { x: 0, y: 1, z: 1 }, { x: 1, y: 2, z: 1 },
  51. { x: 2, y: 3, z: 1 }, { x: 3, y: 3, z: 1 },
  52. { x: 4, y: 2, z: 1 }, { x: 5, y: 1, z: 1 }
  53. ],
  54. xkey: 'x',
  55. ykeys: ['y', 'z'],
  56. labels: ['y', 'z'],
  57. stacked: true
  58. });
  59. window.snapshot();
  60. });
  61. examples.run();