Advertisement
Guest User

Untitled

a guest
Mar 15th, 2017
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 6.72 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html lang="en">
  4.  
  5. <head>
  6.     <meta charset="utf-8">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  8.     <meta http-equiv="x-ua-compatible" content="ie=edge">
  9.     <title>La Voix 5 | Statistiques</title>
  10.     <!-- Font Awesome -->
  11.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">
  12.     <!-- Bootstrap core CSS -->
  13.     <link href="stylesheets/bootstrap4.min.css" rel="stylesheet">
  14.     <!-- Material Design Bootstrap -->
  15.     <link href="stylesheets/mdb.css" rel="stylesheet">
  16.     <!-- Your custom styles (optional) -->
  17.     <link href="stylesheets/style-mdb.css" rel="stylesheet">
  18. </head>
  19.  
  20. <body>
  21. <div class="container">
  22.  
  23.  
  24.  
  25.  
  26.  
  27.     <div class="row">
  28.         <div class="col-md-3">
  29.             <canvas id="ratioTurnAccepted"></canvas>
  30.         </div><!--col-->
  31.     </div>
  32.     </div><!--container-->
  33.  
  34.  
  35.  
  36.     <!-- SCRIPTS -->
  37.     <!-- JQuery -->
  38.     <script type="text/javascript" src="javascript/jquery-3.1.1.min.js"></script>
  39.     <!-- Bootstrap tooltips -->
  40.     <script type="text/javascript" src="javascript/tether.min.js"></script>
  41.     <!-- Bootstrap core JavaScript -->
  42.     <script type="text/javascript" src="javascript/bootstrap4.min.js"></script>
  43.     <!-- MDB core JavaScript -->
  44.     <script type="text/javascript" src="javascript/mdb.js"></script>
  45. <script type="text/javascript">
  46. $(document).ready(function(){
  47. var data = [
  48.     {
  49.         value: 32,
  50.         color:"#F7464A",
  51.         highlight: "#FF5A5E",
  52.         label: "Éric"
  53.     },
  54.     {
  55.         value: 39,
  56.         color: "#46BFBD",
  57.         highlight: "#5AD3D1",
  58.         label: "Isabelle"
  59.     },
  60.     {
  61.         value: 26,
  62.         color: "#FDB45C",
  63.         highlight: "#FFC870",
  64.         label: "Marc"
  65.     },
  66.     {
  67.         value: 27,
  68.         color: "#FDB45C",
  69.         highlight: "#FFC870",
  70.         label: "Pierre"
  71.     }
  72. ]
  73. var option = {
  74.     responsive: true,
  75. };
  76.     // Get the context of the canvas element we want to select
  77. /*
  78. Chart.defaults.global = {
  79.     // Boolean - Whether to animate the chart
  80.     animation: true,
  81.     // Number - Number of animation steps
  82.     animationSteps: 60,
  83.     // String - Animation easing effect
  84.     // Possible effects are:
  85.     // [easeInOutQuart, linear, easeOutBounce, easeInBack, easeInOutQuad,
  86.     //  easeOutQuart, easeOutQuad, easeInOutBounce, easeOutSine, easeInOutCubic,
  87.     //  easeInExpo, easeInOutBack, easeInCirc, easeInOutElastic, easeOutBack,
  88.     //  easeInQuad, easeInOutExpo, easeInQuart, easeOutQuint, easeInOutCirc,
  89.     //  easeInSine, easeOutExpo, easeOutCirc, easeOutCubic, easeInQuint,
  90.     //  easeInElastic, easeInOutSine, easeInOutQuint, easeInBounce,
  91.     //  easeOutElastic, easeInCubic]
  92.     animationEasing: "easeOutQuart",
  93.  
  94.     // Boolean - If we should show the scale at all
  95.     showScale: true,
  96.  
  97.     // Boolean - If we want to override with a hard coded scale
  98.     scaleOverride: false,
  99.  
  100.     // ** Required if scaleOverride is true **
  101.     // Number - The number of steps in a hard coded scale
  102.     scaleSteps: null,
  103.     // Number - The value jump in the hard coded scale
  104.     scaleStepWidth: null,
  105.     // Number - The scale starting value
  106.     scaleStartValue: null,
  107.  
  108.     // String - Colour of the scale line
  109.     scaleLineColor: "rgba(0,0,0,.1)",
  110.  
  111.     // Number - Pixel width of the scale line
  112.     scaleLineWidth: 1,
  113.  
  114.     // Boolean - Whether to show labels on the scale
  115.     scaleShowLabels: true,
  116.  
  117.     // Interpolated JS string - can access value
  118.     scaleLabel: "<%=value%>",
  119.  
  120.     // Boolean - Whether the scale should stick to integers, not floats even if drawing space is there
  121.     scaleIntegersOnly: true,
  122.  
  123.     // Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
  124.     scaleBeginAtZero: false,
  125.  
  126.     // String - Scale label font declaration for the scale label
  127.     scaleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
  128.  
  129.     // Number - Scale label font size in pixels
  130.     scaleFontSize: 12,
  131.  
  132.     // String - Scale label font weight style
  133.     scaleFontStyle: "normal",
  134.  
  135.     // String - Scale label font colour
  136.     scaleFontColor: "#666",
  137.  
  138.     // Boolean - whether or not the chart should be responsive and resize when the browser does.
  139.     responsive: true,
  140.  
  141.     // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
  142.     maintainAspectRatio: true,
  143.  
  144.     // Boolean - Determines whether to draw tooltips on the canvas or not
  145.     showTooltips: true,
  146.  
  147.     // Function - Determines whether to execute the customTooltips function instead of drawing the built in tooltips (See [Advanced - External Tooltips](#advanced-usage-custom-tooltips))
  148.     customTooltips: false,
  149.  
  150.     // Array - Array of string names to attach tooltip events
  151.     tooltipEvents: ["mousemove", "touchstart", "touchmove"],
  152.  
  153.     // String - Tooltip background colour
  154.     tooltipFillColor: "rgba(0,0,0,0.8)",
  155.  
  156.     // String - Tooltip label font declaration for the scale label
  157.     tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
  158.  
  159.     // Number - Tooltip label font size in pixels
  160.     tooltipFontSize: 14,
  161.  
  162.     // String - Tooltip font weight style
  163.     tooltipFontStyle: "normal",
  164.  
  165.     // String - Tooltip label font colour
  166.     tooltipFontColor: "#fff",
  167.  
  168.     // String - Tooltip title font declaration for the scale label
  169.     tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
  170.  
  171.     // Number - Tooltip title font size in pixels
  172.     tooltipTitleFontSize: 14,
  173.  
  174.     // String - Tooltip title font weight style
  175.     tooltipTitleFontStyle: "bold",
  176.  
  177.     // String - Tooltip title font colour
  178.     tooltipTitleFontColor: "#fff",
  179.  
  180.     // Number - pixel width of padding around tooltip text
  181.     tooltipYPadding: 6,
  182.  
  183.     // Number - pixel width of padding around tooltip text
  184.     tooltipXPadding: 6,
  185.  
  186.     // Number - Size of the caret on the tooltip
  187.     tooltipCaretSize: 8,
  188.  
  189.     // Number - Pixel radius of the tooltip border
  190.     tooltipCornerRadius: 6,
  191.  
  192.     // Number - Pixel offset from point x to tooltip edge
  193.     tooltipXOffset: 10,
  194.  
  195.     // String - Template string for single tooltips
  196.     tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>",
  197.  
  198.     // String - Template string for multiple tooltips
  199.     multiTooltipTemplate: "<%= value %>",
  200.  
  201.     // Function - Will fire on animation progression.
  202.     onAnimationProgress: function(){},
  203.  
  204.     // Function - Will fire on animation completion.
  205.     onAnimationComplete: function(){}
  206. }*/
  207. var ctx = document.getElementById("ratioTurnAccepted");
  208. console.log(ctx);
  209. var myPieChart = new Chart(ctx).Pie(data,option);
  210. console.log(myPieChart);
  211. });
  212. </script>
  213. </body>
  214.  
  215. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement