negative.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <!doctype html>
  2. <head>
  3. <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
  4. <script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js"></script>
  5. <script src="../morris.js"></script>
  6. <script src="http://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.min.js"></script>
  7. <script src="lib/example.js"></script>
  8. <link rel="stylesheet" href="lib/example.css">
  9. <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.min.css">
  10. <link rel="stylesheet" href="../morris.css">
  11. </head>
  12. <body>
  13. <h1>Negative values</h1>
  14. <div id="graph"></div>
  15. <pre id="code" class="prettyprint linenums">
  16. var neg_data = [
  17. {"period": "2011-08-12", "a": 100},
  18. {"period": "2011-03-03", "a": 75},
  19. {"period": "2010-08-08", "a": 50},
  20. {"period": "2010-05-10", "a": 25},
  21. {"period": "2010-03-14", "a": 0},
  22. {"period": "2010-01-10", "a": -25},
  23. {"period": "2009-12-10", "a": -50},
  24. {"period": "2009-10-07", "a": -75},
  25. {"period": "2009-09-25", "a": -100}
  26. ];
  27. Morris.Line({
  28. element: 'graph',
  29. data: neg_data,
  30. xkey: 'period',
  31. ykeys: ['a'],
  32. labels: ['Series A'],
  33. units: '%'
  34. });
  35. </pre>
  36. </body>