You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.0 KiB

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestChart.aspx.cs" Inherits="Swift.web.TestChart" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <title>Example</title>
  6. <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
  7. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
  8. <script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
  9. <script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
  10. </head>
  11. <body>
  12. <form id="form1" runat="server">
  13. <div id="graph"></div>
  14. <div id="donut"></div>
  15. </form>
  16. <script>
  17. Morris.Donut({
  18. element: 'donut',
  19. data: [
  20. { value: 70, label: 'Nepal' },
  21. { value: 4, label: 'India' },
  22. { value: 5, label: 'Vietnam' },
  23. { value: 11, label: 'Cambodia' },
  24. { value: 6, label: 'Pakistan' },
  25. { value: 4, label: 'Srilanka' }
  26. ],
  27. formatter: function (x) { return x + "%" }
  28. }).on('click', function (i, row) {
  29. console.log(i, row);
  30. });
  31. var day_data = [
  32. { "elapsed": "Jan", "Txns": 15000 },
  33. { "elapsed": "Feb", "Txns": 18000 },
  34. { "elapsed": "Mar", "Txns": 22000 },
  35. { "elapsed": "Apr", "Txns": 16000 },
  36. { "elapsed": "May", "Txns": 10000 },
  37. { "elapsed": "Jun", "Txns": 28000 },
  38. { "elapsed": "Jul", "Txns": 30000 },
  39. { "elapsed": "Aug", "Txns": 26000 },
  40. { "elapsed": "Sep", "Txns": 12000 },
  41. { "elapsed": "Oct", "Txns": 19000 },
  42. { "elapsed": "Dec", "Txns": 19400 }
  43. ];
  44. new Morris.Line({
  45. element: 'graph',
  46. data: day_data,
  47. xkey: 'elapsed',
  48. ykeys: ['Txns'],
  49. labels: ['Txns'],
  50. parseTime: false
  51. });
  52. </script>
  53. </body>
  54. </html>