donut.html 997 B

1234567891011121314151617181920212223242526272829
  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'},
  20. {value: 15, label: 'bar'},
  21. {value: 10, label: 'baz'},
  22. {value: 5, label: 'A really really long label'}
  23. ],
  24. formatter: function (x) { return x + "%"}
  25. }).on('click', function(i, row){
  26. console.log(i, row);
  27. });
  28. </pre>
  29. </body>