daily pastebin goal
81%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.         var pieData = [
  3.                  {% for item,label,colors in set %}
  4.                      {
  5.                          value: {{item}},
  6.                          label: "{{label}}",
  7.                          color : "{{colors}}"
  8.                      },
  9.                      {% endfor %}
  10.  
  11.  
  12.               ];
  13.  
  14.         // get bar chart canvas
  15.         var mychart = document.getElementById("chart").getContext("2d");
  16.  
  17.         steps = 10
  18.         max = 10
  19.         // draw pie chart
  20.         new Chart(document.getElementById("chart").getContext("2d")).Pie(pieData);
  21.  
  22. </script>
  23.    
  24. @app.route('/user/<username>')
  25. @login_required
  26. def user(username):
  27.  
  28.  
  29.     user = User.query.filter_by(username=username).first_or_404()
  30.  
  31.  
  32.     labels = ["January","February","March","April","May","June","July","August"]
  33.     values = [10,9,8,7,6,4,7,8]
  34.     colors = [ "#F7464A", "#46BFBD", "#FDB45C", "#FEDCBA","#ABCDEF", "#DDDDDD", "#ABCABC"  ]
  35.  
  36.  
  37.     return render_template('user.html', user=user,attendance=attendance, set=zip(values, labels, colors))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top