donut-formatter.html 1.0 KB

123456789101112131415161718192021222324252627
  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>Donut Chart</h1>
  14. <div id="graph"></div>
  15. <pre id="code" class="prettyprint linenums">
  16. Morris.Donut({
  17. element: 'graph',
  18. data: [
  19. {value: 70, label: 'foo', formatted: 'at least 70%' },
  20. {value: 15, label: 'bar', formatted: 'approx. 15%' },
  21. {value: 10, label: 'baz', formatted: 'approx. 10%' },
  22. {value: 5, label: 'A really really long label', formatted: 'at most 5%' }
  23. ],
  24. formatter: function (x, data) { return data.formatted; }
  25. });
  26. </pre>
  27. </body>