Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var pieData = [
- {% for item,label,colors in set %}
- {
- value: {{item}},
- label: "{{label}}",
- color : "{{colors}}"
- },
- {% endfor %}
- ];
- // get bar chart canvas
- var mychart = document.getElementById("chart").getContext("2d");
- steps = 10
- max = 10
- // draw pie chart
- new Chart(document.getElementById("chart").getContext("2d")).Pie(pieData);
- </script>
- @app.route('/user/<username>')
- @login_required
- def user(username):
- user = User.query.filter_by(username=username).first_or_404()
- labels = ["January","February","March","April","May","June","July","August"]
- values = [10,9,8,7,6,4,7,8]
- colors = [ "#F7464A", "#46BFBD", "#FDB45C", "#FEDCBA","#ABCDEF", "#DDDDDD", "#ABCABC" ]
- return render_template('user.html', user=user,attendance=attendance, set=zip(values, labels, colors))
Add Comment
Please, Sign In to add comment